Part Number Hot Search : 
6S3953 5248B 12220 LM24014H ALVCH 022284 LT3791 71C10
Product Description
Full Text Search
 

To Download DUPD78F0884AGAA-GAM-G Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  to our customers, old company name in catalogs and other documents on april 1 st , 2010, nec electronics corporation merged with renesas technology corporation, and renesas electronics corporation took over all the business of both companies. therefore, although the old company name remains in this document, it is a valid renesas electronics document. we appreciate your understanding. renesas electronics website: http://www.renesas.com april 1 st , 2010 renesas electronics corporation issued by: renesas electronics corporation (http://www.renesas.com) send any inquiries to http://www.renesas.com/inquiry.
notice 1. all information included in this document is current as of the date this document is issued. such information, however, is subject to change without any prior notice. before purchasing or using any renesas el ectronics products li sted herein, please confirm the latest product information with a renesas electronics sales office. also , please pay regular and careful attention to additional and different information to be disclosed by rene sas electronics such as that disclosed through our website. 2. renesas electronics does not assume any liability for infringeme nt of patents, copyrights, or other intellectual property ri ghts of third parties by or arising from the use of renesas electroni cs products or techni cal information descri bed in this document . no license, express, implied or otherwise, is granted hereby under any patents, copyri ghts or other intell ectual property right s of renesas electronics or others. 3. you should not alter, modify, copy, or otherwise misappropriate any re nesas electronics product, wh ether in whole or in part . 4. descriptions of circuits, software and other related informat ion in this document are provided only to illustrate the operat ion of semiconductor products and application examples. you are fully re sponsible for the incorporation of these circuits, software, and information in the design of your equipment. renesas electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits, software, or information. 5. when exporting the products or technology described in this doc ument, you should comply with the applicable export control laws and regulations and follow the proc edures required by such laws and re gulations. you should not use renesas electronics products or the technology described in this docum ent for any purpose relating to mil itary applicati ons or use by the military, including but not l imited to the development of weapons of mass de struction. renesas electronics products and technology may not be used for or incor porated into any products or systems whose manufacture, us e, or sale is prohibited under any applicable dom estic or foreign laws or regulations. 6. renesas electronics has used reasonable care in preparing th e information included in this document, but renesas electronics does not warrant that such information is error free. renesas electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein. 7. renesas electronics products ar e classified according to the following three quality grades: ?standard?, ?high quality?, an d ?specific?. the recommended applications for each renesas electronics product de pends on the product?s quality grade, as indicated below. you must check the qua lity grade of each renesas electronics pr oduct before using it in a particular application. you may not use any renesas electronics produc t for any application categorized as ?speci fic? without the prior written consent of renesas electronics. further, you may not use any renesas electronics product for any application for which it is not intended without the prior written consent of renesas electronics. re nesas electronics shall not be in any way liable for any damages or losses incurred by you or third partie s arising from the use of any renesas electronics product for a n application categorized as ?specific? or for which the product is not intende d where you have failed to obtain the prior writte n consent of renesas electronics. the quality grade of each renesas electronics product is ?standard? unless otherwise expressly specified in a renesas electr onics data sheets or data books, etc. ?standard?: computers; office equipmen t; communications e quipment; test and measurement equipment; audio and visual equipment; home electronic a ppliances; machine tools; personal electronic equipmen t; and industrial robots. ?high quality?: transportation equi pment (automobiles, trains, ships, etc.); traffic control systems; anti-disaster systems; an ti- crime systems; safety equipment; and medical equipment not specif ically designed for life support. ?specific?: aircraft; aerospace equipment; submersible repeaters; nuclear reactor control systems; medical equipment or systems for life support (e.g. artificial life support device s or systems), surgical im plantations, or healthcare intervention (e.g. excision, etc.), and any other applicati ons or purposes that pose a di rect threat to human life. 8. you should use the renesas electronics pr oducts described in this document within the range specified by renesas electronics , especially with respect to the maximum ra ting, operating supply voltage range, movement power volta ge range, heat radiation characteristics, installation and other product characteristics. renesas electronics shall have no liability for malfunctions o r damages arising out of the use of renesas electronics products beyond such specified ranges. 9. although renesas electronics endeavors to improve the quality and reliability of its produc ts, semiconductor products have specific characteristics such as the occurrence of failure at a certain rate a nd malfunctions under certain use conditions. fur ther, renesas electronics products are not subject to radiation resistance design. please be sure to implement safety measures to guard them against the possibility of physic al injury, and injury or damage caused by fire in the event of the failure of a renesas electronics product, such as safe ty design for hardware and software in cluding but not limited to redundancy, fire control and malfunction prevention, appropri ate treatment for aging degradation or an y other appropriate measures. because the evaluation of microcomputer software alone is very difficult , please evaluate the safety of the final products or system manufactured by you. 10. please contact a renesa s electronics sales office for details as to environmental matters such as the environmental compatibility of each renesas electronics product. please use renesas electronics products in compliance with all applicable laws and regulations that regul ate the inclusion or use of c ontrolled substances, including wi thout limitation, the eu rohs directive. renesas electronics assumes no liability for damage s or losses occurring as a result of your noncompliance with applicable laws and regulations. 11. this document may not be reproduced or duplicated, in any form, in w hole or in part, without prio r written consent of renes as electronics. 12. please contact a renesa s electronics sales office if you have any questi ons regarding the informat ion contained in this document or renesas electroni cs products, or if you have any other inquiries. (note 1) ?renesas electronics? as used in this document means renesas electronics corporation and also includes its majority- owned subsidiaries. (note 2) ?renesas electronics product(s)? means any product developed or manufactured by or for renesas electronics.
document no. u19180ej1v0ud00 (1st edition) date published march 2009 ns printed in japan 2009 78k0/fc2: pd78f0881a(a), 78f0882a(a), 78f0883a(a), 78f0884a(a), 78f0885a(a), 78f0886a(a), 78f0894a(a), 78f0895a(a), 78f0881a(a2), 78f0882a(a2), 78f0883a(a2), 78f0884a(a2), 78f0885a(a2), 78f0886a(a2) , 78f0894a(a2), 78f0895a(a2) 78k0/fe2: pd78f0887a(a), 78f0888a(a), 78f0889a(a), 78f0890a(a), 78f0887a(a2), 78f0888a(a2), 78f0889a(a2), 78f0890a(a2) 78k0/ff2: pd78f0891a(a), 78f0892a(a), 78f0893a(a), 78f0891a(a2), 78f0892a(a2), 78f0893a(a2) 78k0/fx2 8-bit single-chip microcontrollers user?s manual
user?s manual u19180ej1v0ud 2 [memo]
user?s manual u19180ej1v0ud 3 1 2 3 4 voltage application waveform at input pin waveform distortion due to input noise or a reflected wave may cause malfunction. if the input of the cmos device stays in the area between v il (max) and v ih (min) due to noise, etc., the device may malfunction. take care to prevent chattering noise from entering the device when the input level is fixed, and also in the transition period when the input level passes through the area between v il (max) and v ih (min). handling of unused input pins unconnected cmos device inputs can be cause of malfunction. if an input pin is unconnected, it is possible that an internal input level may be generated due to noise, etc., causing malfunction. cmos devices behave differently than bipolar or nmos devices. input levels of cmos devices must be fixed high or low by using pull-up or pull-down circuitry. each unused pin should be connected to v dd or gnd via a resistor if there is a possibility that it will be an output pin. all handling related to unused pins must be judged separately for each device and according to related specifications governing the device. precaution against esd a strong electric field, when exposed to a mos device, can cause destruction of the gate oxide and ultimately degrade the device operation. steps must be taken to stop generation of static electricity as much as possible, and quickly dissipate it when it has occurred. environmental control must be adequate. when it is dry, a humidifier should be used. it is recommended to avoid using insulators that easily build up static electricity. semiconductor devices must be stored and transported in an anti-static container, static shielding bag or conductive material. all test and measurement tools including work benches and floors should be grounded. the operator should be grounded using a wrist strap. semiconductor devices must not be touched with bare hands. similar precautions need to be taken for pw boards with mounted semiconductor devices. status before initialization power-on does not necessarily define the initial status of a mos device. immediately after the power source is turned on, devices with reset functions have not yet been initialized. hence, power-on does not guarantee output pin levels, i/o settings or contents of registers. a device is not initialized until the reset signal is received. a reset operation must be executed immediately after power-on for devices with reset functions. power on/off sequence in the case of a device that uses different power supplies for the internal operation and external interface, as a rule, switch on the external power supply after switching on the internal power supply. when switching the power supply off, as a rule, switch off the external power supply and then the internal power supply. use of the reverse power on/off sequences may result in the application of an overvoltage to the internal elements of the device, causing malfunction and degradation of internal elements due to the passage of an abnormal current. the correct power on/off sequence must be judged separately for each device and according to related specifications governing the device. input of signal during power off state do not input signals or an i/o pull-up power supply while the device is not powered. the current injection that results from input of such a signal or i/o pull-up power supply may cause malfunction and the abnormal current that passes in the device at this time may cause degradation of internal elements. input of signals during the power off state must be judged separately for each device and according to related specifications governing the device. notes for cmos devices 5 6
user?s manual u19180ej1v0ud 4 eeprom is a trademark of nec electronics corporation. windows is a registered trademark or trademark of microsoft corporation in the united states and/or other countries. superflash is a registered trademark of silicon storage technology, inc. in several countries including the united states and japan.
user?s manual u19180ej1v0ud 5 caution: this product uses superflash ? technology licensed from s ilicon storage technology, inc. the information in this document is current as of march, 2009. the information is subject to change without notice. for actual design-in, refer to the latest publications of nec electronics data sheets or data books, etc., for the most up-to-date specifications of nec electronics products. not all products and/or types are available in every country. please check with an nec electronics sales representative for availability and additional information. no part of this document may be copied or reproduced in any form or by any means without the prior written consent of nec electronics. nec electronics assumes no responsibility for any errors that may appear in this document. nec electronics does not assume any liability for infringement of patents, copyrights or other intellectual property rights of third parties by or arising from the use of nec electronics products listed in this document or any other liability arising from the use of such products. no license, express, implied or otherwise, is granted under any patents, copyrights or other intellectual property rights of nec electronics or others. descriptions of circuits, software and other related information in this document are provided for illustrative purposes in semiconductor product operation and application examples. the incorporation of these circuits, software and information in the design of a customer's equipment shall be done under the full responsibility of the customer. nec electronics assumes no responsibility for any losses incurred by customers or third parties arising from the use of these circuits, software and information. while nec electronics endeavors to enhance the quality, reliability and safety of nec electronics products, customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely. to minimize risks of damage to property or injury (including death) to persons arising from defects in nec electronics products, customers must incorporate sufficient safety measures in their design, such as redundancy, fire-containment and anti-failure features. nec electronics products are classified into the following three quality grades: "standard", "special" and "specific". the "specific" quality grade applies only to nec electronics products developed based on a customer- designated "quality assurance program" for a specific application. the recommended applications of an nec electronics product depend on its quality grade, as indicated below. customers must check the quality grade of each nec electronics product before using it in a particular application. the quality grade of nec electronics products is "standard" unless otherwise expressly specified in nec electronics data sheets or data books, etc. if customers wish to use nec electronics products in applications not intended by nec electronics, they must contact an nec electronics sales representative in advance to determine nec electronics' willingness to support a given application. (note) ? ? ? ? ? ? m8e 02. 11-1 (1) (2) "nec electronics" as used in this statement means nec electronics corporation and also includes its majority-owned subsidiaries. "nec electronics products" means any product developed or manufactured by or for nec electronics (as defined above). computers, office equipment, communications equipment, test and measurement equipment, audio and visual equipment, home electronic appliances, machine tools, personal electronic equipment and industrial robots. transportation equipment (automobiles, trains, ships, etc.), traffic control systems, anti-disaster systems, anti-crime systems, safety equipment and medical equipment (not specifically designed for life support). aircraft, aerospace equipment, submersible repeaters, nuclear reactor control systems, life support systems and medical equipment for life support, etc. "standard": "special": "specific":
user?s manual u19180ej1v0ud 6 introduction readers this manual is intended for user engineer s who wish to understand the functions of the expanded-specification products ( pd78f08xxa) of the 78k0/fx2 microcontrollers and design and develop application system s and programs for these devices. the target products are as follows. ? expanded-specification pro ducts of the 78k0/fc2 ( pd78f088xa): pd78f0881a(a), 78f0882a(a), 78f0883a (a), 78f0884a(a), 78f0885a(a), 78f0886a(a), 78f0894a(a), 78f0895a (a), 78f0881a(a2), 78f0882a(a2), 78f0883a(a2), 78f0884a(a2), 78f0885a (a2), 78f0886a(a2), 78f0894a(a2), 78f0895a(a2) ? expanded-specification pro ducts of the 78k0/fe2 ( pd78f088xa, 78f089xa): pd78f0887a(a), 78f0888a(a), 78f0889a (a), 78f0890a(a), 78f0887a(a2), 78f0888a(a2), 78f0889a(a2), 78f0890a(a2) ? expanded-specification products of the 78k0/ff2 ( pd78f089xa): pd78f0891a(a), 78f0892a(a), 78f0893a (a), 78f0891a(a2), 78f0892a(a2), 78f0893a(a2) for the conventional-specification produc ts of the 78k0/fx2 microcontrollers ( pd78f08xx), see the following manuals. document name document no. 78k0/fc2 user?s manual u17555e 78k0/fe2 user?s manual u17554e 78k0/ff2 user?s manual u17553e differences between c onventional-specification products a nd expanded-specification products the differences between the convent ional-specification products ( pd78f08xx) and expanded-specification products ( pd78f08xxa) of the 78k0/fx2 microc ontrollers are described below. ? a/d conversion time ? the number of flash memory rewrites and retention time ? processing time of the self programming library ? interrupt response time of the self programming library for details, see 1.1 differences between conventi onal-specification products ( pd78f08xx) and expanded-specification products ( pd78f08xxa).
user?s manual u19180ej1v0ud 7 purpose this manual is intended to give users an understanding of the functions described in the organization below. organization the manual for the expanded-specification products of 78k0/fx2 microcontrollers is separated into two parts: this manual and th e instructions edition (common to the 78k0 microcontrollers). 78k0/fx2 user?s manual (this manual) 78k/0 series user?s manual instructions ? pin functions ? internal block functions ? interrupts ? other on-chip peripheral functions ? electrical specifications ? cpu functions ? instruction set ? explanation of each instruction how to read this manual it is assumed that the readers of this ma nual have general knowledge of electrical engineering, logic circuits, and microcontrollers. ? when using this manual as the manual for (a) and (a2) grade products of the expanded-specification products of 78k0/fx2 microcontrollers: only the quality grade differs between st andard products and (a) grade products. read the part number as follows. ? pd78f088ya pd78f088ya(a) pd78f088ya(a2) (y = 1 to 9) ? pd78f089ya pd78f089ya(a) pd78f089ya(a2) (y = 0 to 5) ? to gain a general understanding of functions: read this manual in the order of the contents . ? how to interpret the register format: for a bit number enclosed in brackets, the bit name is defined as a reserved word in the assembler, and is already defined in the header file named sfrbit.h in the c compiler. ? to check the details of a register when you know the register name: refer to appendix c register index . ? to know details of the 78k 0 microcontroller instructions: refer to the separate document 78k/0 series instructions user?s manual (u12326e) . conventions data significance: higher digits on the left and lower digits on the right active low representations: (overscore over pin and signal name) note : footnote for item marked with note in the text. caution : information requiring particular attention remark : supplementary information numerical representations: binary ... or b decimal ... hexadecimal ... h
user?s manual u19180ej1v0ud 8 related documents the related documents indicated in this pu blication may include preliminary versions. however, preliminary versions are not marked as such. documents related to devices document name document no. 78k0/fx2 user?s manual this manual 78k/0 series instructions user?s manual u12326e documents related to development tools (hardware) (user?s manuals) document name document no. qb-78k0fx2 in-circuit emulator u17534e qb-78k0mini on-chip debug emulator u17029e qb-mini2 on-chip debug emulator with programming function u18371e documents related to fl ash memory programming document name document no. pg-fp5 flash memory programmer user?s manual u18865e pg-fp4 flash memory programmer user?s manual u15260e caution the related documents listed above are subject to change without notice. be sure to use the latest version of each document when designing.
user?s manual u19180ej1v0ud 9 documents related to development tools (software) (user?s manuals) document name document no. operation u17199e language u17198e ra78k0 ver.3.80 assembler package note 1 structured assembly language u17197e 78k0 assembler package ra78k0 ver.4.01 operating precautions note 1 zud-cd-07-0181-e operation u17201e cc78k0 ver.3.70 c compiler note 2 language u17200e 78k0 c compiler cc78k0 ver. 4.00 operating precautions note 2 zud-cd-07-0103-e operation u18601e sm+ system simulator user open interface u18212e id78k0-qb ver.2.94 integrat ed debugger operation u18330e id78k0-qb ver.3.00 integrat ed debugger operation u18492e pm plus ver.5.20 note 3 u16934e pm+ ver.6.30 note 4 u18416e notes 1. this document is installed into the pc together wit h the tool when installing ra78k0 ver. 4.01. for descriptions not included in ?78k0 assembler package ra 78k0 ver. 4.01 operating precautions?, refer to the user?s manual of ra78k0 ver. 3.80. 2. this document is installed into the pc together with the tool when installing cc78k0 ver. 4.00. for descriptions not included in ?78k0 c compiler cc78k0 ver. 4.00 operating precautions?, refer to the user?s manual of cc78k0 ver. 3.70. 3. pm plus ver. 5.20 is the integrated developm ent environment included with ra78k0 ver. 3.80. 4. pm+ ver. 6.30 is the integrated development environment included with ra78k0 ver. 4.01. software tool (assembler, c compiler, debugger, and simulator) products of different versions can be managed. other documents document name document no. semiconductor selection guide ? products and packages ? x13769x semiconductor device mount manual note quality grades on nec semiconductor devices c11531e nec semiconductor device reliability/quality control system c10983e guide to prevent damage for semiconductor devi ces by electrostatic discharge (esd) c11892e note see the ?semiconductor device mo unt manual? website (http://www.necel .com/pkg/en/mount/index.html). caution the related documents listed above are subject to change without notice. be sure to use the latest version of each document when designing.
user?s manual u19180ej1v0ud 10 contents chapter 1 outline ........................................................................................................... ................. 19 1.1 differences between conventional-specification products ( pd78f08xx) and expanded- specification products ( pd78f08xxa) ................................................................................... 19 1.1.1 a/d c onversion time ..................................................................................................... ..................... 20 1.1.2 number of flash memory rewrites and ret ention time of (a) grade products and (a2) grade products ............................................................................................................................... ........................... 20 1.1.3 processing time for self programmi ng libr ary ............................................................................ ........ 21 1.1.4 interrupt response time for self progr amming li brary .................................................................... ..... 27 1.2 features.................................................................................................................. ....................... 31 1.3 applications .............................................................................................................. .................... 32 1.4 ordering information ...................................................................................................... ............. 32 1.5 pin configuration (top view) .............................................................................................. ........ 34 1.5.1 78k 0/fc2 ................................................................................................................ .......................... 34 1.5.2 78k 0/fe2 ................................................................................................................ .......................... 36 1.5.3 78k0/ff2 ................................................................................................................ .......................... 37 1.6 pin identification........................................................................................................ ................... 38 1.7 block diagram ............................................................................................................. ................. 39 1.7.1 78k 0/fc2 ................................................................................................................ .......................... 39 1.7.2 78k 0/fe2 ................................................................................................................ .......................... 41 1.7.3 78k0/ff2 ................................................................................................................ .......................... 42 1.8 outline of functions ...................................................................................................... .............. 43 chapter 2 pin functions .................................................................................................... ........... 46 2.1 pin function list ......................................................................................................... ................. 46 2.1.1 78k 0/fc2 ................................................................................................................ .......................... 47 2.1.2 78k 0/fe2 ................................................................................................................ .......................... 50 2.1.3 78k0/ff2 ................................................................................................................ .......................... 53 2.2 description of pin functions .............................................................................................. ........ 57 2.2.1 p00, p01, p05, p06 (port 0) ............................................................................................. ................. 57 2.2.2 p10 to p17 (por t 1) ..................................................................................................... ....................... 58 2.2.3 p30 to p33 (por t 3) ..................................................................................................... ....................... 59 2.2.4 p40 to p47 (por t 4) ..................................................................................................... ....................... 60 2.2.5 p50 to p57 (por t 5) ..................................................................................................... ....................... 61 2.2.6 p60 to p67 (por t 6) ..................................................................................................... ....................... 61 2.2.7 p70 to p76 (por t 7) ..................................................................................................... ....................... 62 2.2.8 p80 to p87 (por t 8) ..................................................................................................... ....................... 63 2.2.9 p90 to p97 (por t 9) ..................................................................................................... ....................... 64 2.2.10 p120 to p124 ( port 12) ................................................................................................. ................... 64 2.2.11 p130 to p132 ( port 13) ................................................................................................. ................... 66 2.2.12 av ref , av ss , v dd , ev dd , v ss and ev ss ........................................................................................... 66 2.2.13 reset .................................................................................................................. .......................... 67 2.2.14 regc................................................................................................................... ........................... 67 2.2.15 flmd0 .................................................................................................................. .......................... 67 2.3 pin i/o circuits and recomme nded connection of unused pins .... ....................................... 68
user?s manual u19180ej1v0ud 11 chapter 3 cpu architecture ................................................................................................. ..... 72 3.1 memory space.............................................................................................................. ................ 72 3.1.1 internal progr am memory space ........................................................................................... .............80 3.1.2 memory bank ( pd78f0889a, 78f0890a , 78f0892a to 78f 0895a onl y).........................................82 3.1.3 internal dat a memory space.............................................................................................. .................84 3.1.4 special function register (sfr) area .................................................................................... ..............84 3.1.5 data me mory addr essing .................................................................................................. .................85 3.2 processor registers ....................................................................................................... ............. 91 3.2.1 contro l regist ers....................................................................................................... ..........................91 3.2.2 general-pur pose registers ............................................................................................... ..................95 3.2.3 special functi on register s (sfrs) ....................................................................................... .............96 3.3 instruction address addressing . ........................................................................................... .. 103 3.3.1 relati ve addre ssing..................................................................................................... .....................103 3.3.2 immedi ate addres sing.................................................................................................... ..................104 3.3.3 table indi rect addr essing ............................................................................................... ..................105 3.3.4 regist er addre ssing ..................................................................................................... ....................106 3.4 operand address addressing .................................... ............................................................ .. 107 3.4.1 impli ed addre ssing ...................................................................................................... .....................107 3.4.2 regist er addre ssing ..................................................................................................... ....................108 3.4.3 direct addre ssing ....................................................................................................... ......................109 3.4.4 short di rect addr essing ................................................................................................. ...................110 3.4.5 special function register (sfr ) addres sing.............................................................................. ........111 3.4.6 register i ndirect addr essi ng............................................................................................ .................112 3.4.7 based addre ssing ........................................................................................................ ....................113 3.4.8 based in dexed addr essing................................................................................................ ...............114 3.4.9 stack addre ssing........................................................................................................ ......................115 chapter 4 memory bank select function ( pd78f0889a, 78f0890a, 78f0892a to 78f0895a only) ............................................................................................................ 116 4.1 memory bank............................................................................................................... ............... 116 4.2 difference in repr esentation of memory space .................. ................................................... 117 4.3 memory bank select register (bank)..................................................................................... 118 4.4 selecting memory bank..................................................................................................... ........ 119 4.4.1 referencing val ues between me mory banks ................................................................................. ..119 4.4.2 branching instruct ion between me mory banks.............................................................................. ...121 4.4.3 subroutine call bet ween memory banks .................................................................................... ......123 4.4.4 instruction branch to bank area by inte rrupt............................................................................ .........125 chapter 5 port functions ................................................................................................... ...... 127 5.1 port functions ............................................................................................................ ................ 127 5.2 port configuration ........................................................................................................ ............. 130 5.2.1 po rt 0 .................................................................................................................. .............................131 5.2.2 po rt 1 .................................................................................................................. .............................134 5.2.3 po rt 3 .................................................................................................................. .............................140 5.2.4 po rt 4 .................................................................................................................. .............................145 5.2.5 po rt 5 .................................................................................................................. .............................146 5.2.6 po rt 6 .................................................................................................................. .............................147 5.2.7 po rt 7 .................................................................................................................. .............................150
user?s manual u19180ej1v0ud 12 5.2.8 po rt 8.................................................................................................................. ..............................155 5.2.9 po rt 9.................................................................................................................. ..............................157 5.2.10 po rt 12................................................................................................................ ............................159 5.2.11 po rt 13................................................................................................................ ............................162 5.3 registers controlling port function .......................... ............................................................. . 166 5.4 port function operations .................................................................................................. ........ 178 5.4.1 writi ng to i/o port ..................................................................................................... ........................178 5.4.2 reading from i/o port................................................................................................... ....................178 5.4.3 operatio ns on i/o port.................................................................................................. ....................178 5.5 settings of port mode register and output latch when using alternate function........... 179 5.6 cautions on 1-bit manipulation instruction for port register n (p n).................................... 181 chapter 6 clock generator .................................................................................................. .. 182 6.1 functions of clock genera tor.............................................................................................. ..... 182 6.2 configuration of clock gene rator .......................................................................................... .. 183 6.3 registers controlling clock generator.......................... .......................................................... 1 85 6.4 system clock oscillator ................................................................................................... ......... 194 6.4.1 x1 oscill ator........................................................................................................... ...........................194 6.4.2 xt1 oscilla tor.......................................................................................................... ..........................194 6.4.3 when subsystem clock is not us ed ........................................................................................ ..........197 6.4.4 internal hi gh-speed os cillator.......................................................................................... ..................197 6.4.5 internal lo w-speed os cillator ........................................................................................... ..................197 6.4.6 pr escaler ............................................................................................................... ...........................197 6.5 clock generator operation ................................................................................................. ...... 198 6.6 controlling clock......................................................................................................... ............... 203 6.6.1 controlling hi gh-speed system clock ..................................................................................... ...........203 6.6.2 example of controlling intern al high-speed osc illation clock ............................................................ .206 6.6.3 example of cont rolling subsyst em clock.................................................................................. .........208 6.6.4 controlling internal low-speed oscillati on cloc k ........................................................................ ........210 6.6.5 clocks supplied to cp u and periphera l hardw are .......................................................................... ..210 6.6.6 cpu clock stat us transiti on diagr am..................................................................................... ............211 6.6.7 condition before changing cpu clock and processi ng after changing cpu cl ock ...........................216 6.6.8 time required for switchover of cpu clock and main system cl ock .................................................217 6.6.9 conditions before clock osc illation is stopp ed .......................................................................... ........218 chapter 7 16-bit timer/event counters 00 to 03 ........................................................... 219 7.1 functions of 16-bit timer/event counters 00 to 03................................................................ 220 7.2 configuration of 16-bit timer/ event counters 00 to 03 .............. ........................................... 221 7.3 registers controlling 16-bit ti mer/event counters 00 to 03........ ......................................... 232 7.4 operation of 16-bit timer/event counters 00 to 03 ................................................................ 253 7.4.1 interval timer oper ation................................................................................................ .....................253 7.4.2 ppg out put operat ions ................................................................................................... ..................256 7.4.3 pulse width m easurement operati ons ...................................................................................... ........259 7.4.4 external event counter operatio n........................................................................................ ..............270 7.4.5 square-wave output op eration ............................................................................................ .............273 7.4.6 one-shot pul se output operatio n ......................................................................................... .............275 7.5 special use of tm0n ....................................................................................................... ........... 281 7.5.1 rewriting cr01n during tm0n operatio n ................................................................................... ......281
user?s manual u19180ej1v0ud 13 7.5.2 setting l vs0n and lvr0n ................................................................................................. ..............281 7.6 cautions for 16-bit timer/event counters 00 to 03 ................................................................ 283 chapter 8 8-bit timer/event counters 50 and 51 .......................................................... 288 8.1 functions of 8-bit timer/event counters 50 and 51........................ ....................................... 288 8.2 configuration of 8-bit timer/ event counters 50 and 51 ........................................................ 290 8.3 registers controlling 8-bit time r/event counters 50 and 51 ............................................... 292 8.4 operations of 8-bit timer/even t counters 50 and 51...................... ....................................... 298 8.4.1 operation as interval timer ............................................................................................. ..................298 8.4.2 operation as ex ternal event count er ..................................................................................... ...........300 8.4.3 square-wave output op eration ............................................................................................ .............301 8.4.4 pwm out put operat ion .................................................................................................... .................302 8.5 cautions for 8-bit timer/event counters 50 and 51 ............................................................... 306 chapter 9 8-bit timers h0 and h1 ........................................................................................ .. 307 9.1 functions of 8-bit timers h0 and h1 ........................ ............................................................... 307 9.2 configuration of 8-bit timers h0 and h1.................. ............................................................... 30 7 9.3 registers controlling 8-bit timers h0 and h1 ......... ............................................................... 311 9.4 operation of 8-bit timers h0 and h1 ........................ ............................................................... 317 9.4.1 operation as interv al timer/squar e-wave output .......................................................................... .....317 9.4.2 operation as pwm output mode ............................................................................................ ..........320 9.4.3 carrier generator mode oper ation (8-bit ti mer h1 only).................................................................. ..326 chapter 10 watch timer ..................................................................................................... ........ 333 10.1 functions of watch timer ................................................................................................. ...... 333 10.2 configuration of watch time r............................................................................................. .... 334 10.3 register controlling watch timer......................................................................................... . 335 10.4 watch timer operations................................................................................................... ....... 337 10.4.1 watch ti mer operat ion .................................................................................................. ..................337 10.4.2 interval timer oper ation ............................................................................................... ...................338 10.5 cautions for watch timer ................................................................................................. ...... 339 chapter 11 watchdog timer .................................................................................................. ... 340 11.1 functions of watchdog timer .................................. ............................................................ .. 340 11.2 configuration of watchdog time r.......................................................................................... 341 11.3 register controlling watchdog time r ................................................................................... 342 11.4 operation of watchdog timer................................... ........................................................... ... 343 11.4.1 controlling oper ation of wa tchdog ti mer................................................................................ .........343 11.4.2 setting overflow time of wa tchdog ti mer................................................................................ .........345 11.4.3 setting window open pe riod of watc hdog ti mer ........................................................................... ...346 chapter 12 clock output/buzzer output controller............................................... 348 12.1 functions of clock output/buzze r output controller....................... ................................... 348 12.2 configuration of clock output /buzzer output controller ................................................... 349 12.3 register controlling clock output/buzzer output controller............................................. 349 12.4 clock output/buzzer output cont roller operations............................................................. 352 12.4.1 clock out put operat ion ................................................................................................. ..................352 12.4.2 operation as buzzer output ............................................................................................. ...............352
user?s manual u19180ej1v0ud 14 chapter 13 a/d converter ................................................................................................... ...... 353 13.1 function of a/d converter................................................................................................ ....... 353 13.2 configuration of a/d converter ........................................................................................... ... 354 13.3 registers used in a/d converter.......................................................................................... .. 356 13.4 a/d converter operations ............................................... .................................................. ...... 366 13.4.1 basic operations of a/d c onverter ...................................................................................... ............366 13.4.2 input voltage and conversion results ................................................................................... ...........368 13.4.3 a/d converte r operati on mode........................................................................................... .............370 13.5 how to read a/d converter characteristics tabl e............................................................... 372 13.6 cautions for a/d converter ............................................................................................... ...... 374 chapter 14 serial interfaces uart60 and uart61.......................................................... 378 14.1 functions of serial interfaces uart60 and uart61 .................. ......................................... 378 14.2 configurations of serial interface uart60 and uart61..................................................... 384 14.3 registers controlling serial interfaces uart 60 and uart61 ............................................ 388 14.4 operations of serial interface uart60 and uart 61............................................................ 408 14.4.1 operat ion stop mode.................................................................................................... ..................408 14.4.2 asynchronous serial interface (u art) mode .............................................................................. ...409 14.4.3 dedicated ba ud rate g enerat or.......................................................................................... .............424 chapter 15 serial interfaces csi10 and csi11 ................................................................ 430 15.1 functions of serial interfaces csi10 and csi11 ................................................................... 430 15.2 configuration of serial interf aces csi10 and csi11 ............................................................. 431 15.3 registers controlling serial interfaces csi10 a nd csi11 .................................................... 433 15.4 operation of serial interfaces csi10 and csi11... ................................................................. 441 15.4.1 operat ion stop mode.................................................................................................... ..................441 15.4.2 3-wire se rial i/o mode ................................................................................................. ...................442 chapter 16 can controller .................................................................................................. ... 454 16.1 outline description ...................................................................................................... ............ 454 16.1.1 f eatures ............................................................................................................... ..........................454 16.1.2 overview of f uncti ons .................................................................................................. ...................455 16.1.3 conf iguration .......................................................................................................... ........................456 16.2 can protocol ............................................................................................................. ............... 457 16.2.1 fram e forma t........................................................................................................... .......................457 16.2.2 fr ame ty pes ............................................................................................................ .......................458 16.2.3 data frame and remote frame ............................................................................................ ............458 16.2.4 erro r frame ............................................................................................................ .........................466 16.2.5 over load fr ame......................................................................................................... ......................467 16.3 functions ................................................................................................................ .................. 468 16.3.1 determinin g bus pr iority ............................................................................................... ..................468 16.3.2 bit stuffi ng ........................................................................................................... ...........................468 16.3.3 mult i masters .......................................................................................................... ........................468 16.3.4 mu lti cast ............................................................................................................. ...........................468 16.3.5 can sleep mode/ca n stop mode function .................................................................................. ..468 16.3.6 error c ontrol f unction ................................................................................................. .....................469 16.3.7 baud rate control fu nction ............................................................................................. .................475 16.4 connection with target system................................ ............................................................ .. 479
user?s manual u19180ej1v0ud 15 16.5 internal registers of can controller ...................... ............................................................... 480 16.5.1 can controlle r configuration ........................................................................................... ...............480 16.5.2 register access type................................................................................................... ...................481 16.5.3 register bi t configuration ............................................................................................. ..................490 16.6 bit set/clear function................................................................................................... ........... 494 16.7 control registers ........................................................................................................ ............. 496 16.8 can controller initialization ............................................................................................ ....... 531 16.8.1 initializati on of can module ........................................................................................... ................531 16.8.2 initializati on of messa ge buffe r....................................................................................... ................531 16.8.3 redefinition of message buffer ......................................................................................... .............531 16.8.4 transition from initia lization mode to operation mode .................................................................. ..532 16.8.5 resetting error count er c0erc of can m odule ............................................................................ 533 16.9 message reception........................................................................................................ .......... 534 16.9.1 message recept ion...................................................................................................... ...................534 16.9.2 receiv e data read ...................................................................................................... ..................535 16.9.3 receive hist ory list fu nction.......................................................................................... ..................536 16.9.4 mask function .......................................................................................................... .......................538 16.9.5 multi buffer re ceive block functi on .................................................................................... ..............540 16.9.6 remote fr ame rec eption................................................................................................. ................541 16.10 message transmission.................................................................................................... ...... 542 16.10.1 message transmi ssion .................................................................................................. ...............542 16.10.2 transmit hist ory list f unction........................................................................................ .................544 16.10.3 automatic blo ck transmissi on (abt) .................................................................................... ........546 16.10.4 transmission abort process ............................................................................................ .............547 16.10.5 remote fr ame trans mission ............................................................................................. ............548 16.11 power save modes........................................................................................................ ......... 549 16.11.1 can sleep m ode ........................................................................................................ ..................549 16.11.2 can stop m ode......................................................................................................... ...................551 16.11.3 example of usi ng power savi ng modes................................................................................... .....552 16.12 interrupt function ...................................................................................................... ............ 553 16.13 diagnosis functions and special operational mode s ....................................................... 554 16.13.1 receiv e-only mode ..................................................................................................... .................554 16.13.2 single- shot mode ...................................................................................................... ...................555 16.13.3 self -test mode ........................................................................................................ ......................556 16.13.4 receive/transmit operati on in each oper ation m ode ................................................................. 557 16.14 time stamp function..................................................................................................... ........ 558 16.14.1 time st amp func tion................................................................................................... ..................558 16.15 baud rate settings ...................................................................................................... .......... 560 16.15.1 baud ra te se ttings .................................................................................................... ....................560 16.15.2 representat ive examples of baud rate setti ngs ......................................................................... ..564 16.16 operation of can controller............................................................................................. .... 568 chapter 17 interrupt functions ............................................................................................ 5 95 17.1 interrupt function types........................................... ...................................................... ........ 595 17.2 interrupt sources and configuration ..................................................................................... 5 95 17.3 registers controlling interrupt functions ............. ............................................................... 599 17.4 interrupt servicing operati ons ........................................................................................... .... 610 17.4.1 maskable interr upt acknow ledgement..................................................................................... .......610
user?s manual u19180ej1v0ud 16 17.4.2 software interrupt request acknow ledgement ............................................................................. ...612 17.4.3 multiple in terrupt se rvicing........................................................................................... ...................613 17.4.4 interrupt request hold ................................................................................................. ....................616 chapter 18 standby function ................................................................................................ .. 617 18.1 standby function and co nfiguration ..................................................................................... 61 7 18.1.1 standby func tion....................................................................................................... ......................617 18.1.2 registers contro lling standby function................................................................................. ...........617 18.2 standby function operation ............................................................................................... .... 620 18.2.1 ha lt m ode .............................................................................................................. ......................620 18.2.2 st op m ode.............................................................................................................. ......................625 chapter 19 reset function.................................................................................................. ...... 632 19.1 register for confirming reset source ......................... .......................................................... 64 0 chapter 20 multiplier/divider ............................................................................................... .... 641 20.1 functions of multiplier/d ivider.......................................................................................... ...... 641 20.2 configuration of multiplier/ divider ...................................................................................... ... 641 20.3 register controlling multiplier/divider .................... .............................................................. 645 20.4 operations of multiplier/di vider......................................................................................... ..... 646 20.4.1 multiplica tion oper ation............................................................................................... ....................646 20.4.2 divisio n operat ion..................................................................................................... ......................648 chapter 21 power-on-clear circuit...................................................................................... 650 21.1 functions of power-on-clear circuit........................ .............................................................. 650 21.2 configuration of power-on-clea r circuit ............................................................................... 651 21.3 operation of power-on-clear circuit ........................ .............................................................. 651 21.4 cautions for power-on-clear circuit ........................ .............................................................. 654 chapter 22 low-voltage detector ....................................................................................... 656 22.1 functions of low-voltage detector.......................... .............................................................. 656 22.2 configuration of low-voltage detector ................................................................................. 657 22.3 registers controlling low-voltage detector............... .......................................................... 657 22.4 operation of low-voltage detector .......................... .............................................................. 660 22.4.1 when us ed as re set ..................................................................................................... ..................661 22.4.2 when used as interrupt ................................................................................................. .................666 22.5 cautions for low-voltage detector .......................... .............................................................. 671 chapter 23 option byte..................................................................................................... .......... 674 23.1 functions of option by tes ................................................................................................ ...... 674 23.2 format of option byte .................................................................................................... ......... 676 chapter 24 flash memory .................................................................................................... ...... 679 24.1 internal memory size switching register................ .............................................................. 679 24.2 internal expansion ram size switching register ................................................................ 680 24.3 writing with flash memory programmer ............................................................................... 681 24.4 programming environment .................................................................................................. ... 693 24.5 communication mode....................................................................................................... ....... 693
user?s manual u19180ej1v0ud 17 24.6 connection of pins on board.............................................................................................. .... 695 24.6.1 fl md0 pin .............................................................................................................. .......................695 24.6.2 serial interfac e pins.................................................................................................. ......................695 24.6.3 r eset pin .............................................................................................................. .......................697 24.6.4 po rt pins.............................................................................................................. ...........................697 24.6.5 re gc pin ............................................................................................................... ........................697 24.6.6 other signal pins ...................................................................................................... ......................697 24.6.7 powe r suppl y........................................................................................................... .......................698 24.7 programming method ....................................................................................................... ....... 699 24.7.1 controlli ng flash memory ............................................................................................... ................699 24.7.2 flash memory programmi ng mode .......................................................................................... ......699 24.7.3 selecting communicati on mode ........................................................................................... ..........700 24.7.4 communi cation co mmands................................................................................................. ...........701 24.8 security settings........................................................................................................ .............. 702 24.9 processing time for each command when pg-fp4 or pg-fp5 is used (reference)...... 704 24.10 flash memory programming by self-programming.. ......................................................... 706 24.10.1 registers used for se lf-programming func tion.......................................................................... ....715 24.11 boot swap function ...................................................................................................... ........ 719 chapter 25 on-chip debug function ..................................................................................... 721 25.1 outline of functions ..................................................................................................... ........... 721 25.2 connection with minicube or qb-mini2 ................ .............................................................. 722 25.3 connection circuit examples ................................... ........................................................... ... 723 25.4 reserved area used by qb-78k0mini and qb-min i2 .......................................................... 725 25.5 on-chip debug security id ................................................................................................ ..... 726 25.6 restrictions and cautions on on-chip debug function .................. ................................... 726 chapter 26 instruction set ................................................................................................. ..... 727 26.1 conventions used in operation list........................ .............................................................. 7 27 26.1.1 operand identifiers and specificat ion me thods .......................................................................... ....727 26.1.2 description of operation column........................................................................................ .............728 26.1.3 description of flag operati on colu mn ................................................................................... ...........728 26.2 operation list ........................................................................................................... ................ 729 26.3 instructions listed by addressing type ................ ............................................................... 737 chapter 27 electrical specifications ((a) grade products).................................. 740 27.1 absolute maximum ratings ................................................................................................. ... 742 27.2 oscillator characteristics...................................... ......................................................... ......... 744 27.3 dc characteristics ....................................................................................................... ............ 746 27.4 ac characteristics ....................................................................................................... ............ 752 27.5 data retention characteristics................................ ........................................................... .... 762 27.6 flash eeprom programming characteristics.......... ............................................................ 763 chapter 28 electrical specifications ((a2) grade products)................................ 764 28.1 absolute maximum ratings ................................................................................................. ... 766 28.2 oscillator characteristics...................................... ......................................................... ......... 768 28.3 dc characteristics ....................................................................................................... ............ 770 28.4 ac characteristics ....................................................................................................... ............ 776
user?s manual u19180ej1v0ud 18 28.5 data retention characteristics ................................. .......................................................... .... 786 28.6 flash eeprom programming characteristics............ .......................................................... 787 chapter 29 package drawings ................................................................................................ 788 29.1 78k0/fc2 ................................................................................................................. .................. 788 29.2 78k0/fe2 ................................................................................................................. .................. 790 29.3 78k0/ff2................................................................................................................. ................... 792 chapter 30 recommended soldering conditions........................................................... 794 chapter 31 cautions for wait.............................................................................................. ... 795 31.1 cautions for wait........................................................................................................ .............. 795 31.2 peripheral hardware that gene rates wait ............................................................................ 796 31.3 example of wait occurrence............................................................................................... .... 798 appendix a development tools............................................................................................... 799 a.1 software package .......................................................................................................... ............ 803 a.2 language processing software ....................................... ....................................................... . 803 a.3 flash memory programming tools.......................................................................................... 80 4 a.3.1 when using flash memory programme r pg-fp5, fl-pr5, fg -fp4, and fl -pr4 ...........................804 a.3.2 when using on-chip debug emulator with programm ing function qb-mini2....................................804 a.4 debugging tools (hardware)............................................ .................................................... .... 805 a.4.1 when using in-circu it emulator qb-78k0fx2............................................................................... ....805 a.4.2 when using on-chip de bug emulator qb -78k0min i ........................................................................806 a.4.3 when using on-chip debug emulator with programm ing function qb-mini2....................................806 a.5 debugging tools (software)................................................ ................................................ ..... 807 appendix b notes on target system design ................................................................... 808 appendix c register index .................................................................................................. ....... 814 c.1 register index (in alphabetical order with respect to register names) ............................ 814 c.2 register index (in alphabetical order with respect to register symbol)........................... 819 appendix d list of cautions ............................................................................................... ...... 824
user?s manual u19180ej1v0ud 19 chapter 1 outline 1.1 differences between conventional-specification products ( pd78f08xx) and expanded- specification products ( pd78f08xxa) this manual describes the functions of the expanded-specification products ( pd78f08xxa) of the 78k0/fx2 microcontrollers. the differences between the conven tional-specification products ( pd78f08xx) and expanded-specification products ( pd78f08xxa) of the 78k0/fx2 microc ontrollers are described below. ? a/d conversion time ? the number of flash memory rewrites and retent ion time of (a) grade products and (a2) grade products ? processing time of the self programming library ? interrupt response time of the self programming library remark for the conventional-specification products ( pd78f08xx) of the 78k0/fx2 microcontrollers, refer to the manual of each product. for the manual name a nd document number of each product, refer to the introduction .
chapter 1 outline user?s manual u19180ej1v0ud 20 1.1.1 a/d conversion time the conversion time of a/d converter is as follows. (1) conventional-specification products ( pd78f08xx) parameter symbol conditions min. max. unit 4.0 v av ref 5.5 v 6.1 36.7 2.7 v av ref < 4.0 v 12.2 36.7 conversion time t conw 2.3 v av ref < 2.7 v 27 66.6 s (2) expanded-specification products ( pd78f08xxa) parameter symbol conditions min. max. unit 4.0 v av ref 5.5 v 6.1 66.6 2.7 v av ref < 4.0 v 12.2 66.6 conversion time t conw 2.3 v av ref < 2.7 v 27 66.6 s 1.1.2 number of flash me mory rewrites and retention time of (a ) grade products and (a2) grade products item conventional-specification products ( pd78f08xx) expanded-specification products ( pd78f08xxa) ? when a flash memory programmer is used, and the libraries provi ded by nec electronics are used ? for program update 1,000 times (retention: 15 years) ? when the eeprom emulation libraries provided by nec el ectronics are used ? the rewritable rom size: 4 kb ? for data update 10,000 times (retention: 5 years) number of rewrites per chip (retention time) 100 times (retention: 15 years) conditions other than the above 100 times (retention: 10 years)
chapter 1 outline user?s manual u19180ej1v0ud 21 1.1.3 processing time fo r self programming library (1) conventional-specification products ( pd78f08xx) (1/3) <1> when internal high-speed osc illation clock is used and entry ram is located outside short direct addressing range processing time ( s) normal model of c compiler static model of c compiler/assembler library name min. max. min. max. self programming start library 4.25 initialize library 977.75 mode check library 753.875 753.125 block blank check library 12770.875 12765.875 block erase library 36909.5 356318 36904.5 356296.25 word write library 1214 (1214.375) 2409 (2409.375) 1207 (1207.375) 2402 (2402.375) block verify library 25618.875 25613.875 self programming end library 4.25 option value: 03h 871.25 (871.375) 866 (866.125) option value: 04h 863.375 (863.5) 858.125 (858.25) get information library option value: 05h 1024.75 (1043.625) 1037.5 (1038.375) set information library 105524.75 790809.375 105523.75 790808.375 eeprom write library 1496.5 (1496.875) 2691.5 (2691.875) 1489.5 (1489.875) 2684.5 (2684.875) <2> when internal high-speed oscillation clock is used and entry ram is located in short direct addressing range processing time ( s) normal model of c compiler static model of c compiler/assembler library name min. max. min. max. self programming start library 4.25 initialize library 443.5 mode check library 219.625 218.875 block blank check library 12236.625 12231.625 block erase library 36363.25 355771.75 36358.25 355750 word write library 679.75 (680.125) 1874.75 (1875.125) 672.75 (673.125) 1867.75 (1868.125) block verify library 25072.625 25067.625 self programming end library 4.25 option value: 03h 337 (337.125) 331.75 (331.875) option value: 04h 329.125 (239.25) 323.875 (324) get information library option value: 05h 502.25 (503.125) 497 (497.875) set information library 104978.5 541143.125 104977.5 541142.125 eeprom write library 962.25 (962.625) 2157.25 (2157.625) 955.25 (955.625) 2150.25 (2150.625) remark values in parentheses indicate values when a writ e start address structure is located other than in the internal high-speed ram.
chapter 1 outline user?s manual u19180ej1v0ud 22 (1) conventional-specification products ( pd78f08xx) (2/3) <3> when high-speed system clock (x1 oscillation or external clock input) is used and entry ram is located outside short direct addressing range processing time ( s) normal model of c compiler static model of c compiler/assembler library name min. max. min. max. self programming start library 34/f cpu initialize library 49/f cpu + 485.8125 mode check library 35/f cpu + 374.75 29/f cpu + 374.75 block blank check library 174/f cpu + 6382.0625 134/f cpu + 6382.0625 block erase library 174/f cpu + 31093.875 174/f cpu + 298948.125 134/f cpu + 31093.875 134/f cpu + 298948.125 word write library 318 (321)/f cpu + 644.125 318 (321)/f cpu + 1491.625 262 (265)/f cpu + 644.125 262 (265)/f cpu + 1491.625 block verify library 174/f cpu + 13448.5625 134/f cpu + 13448.5625 self programming end library 34/f cpu option value: 03h 171 (172 )/f cpu + 432.4375 129 (130)/f cpu + 432.4375 option value: 04h 181 (182)/f cpu + 427.875 139 (140)/f cpu + 427.875 get information library option value: 05h 404 (411)/f cpu + 496.125 362 (369)/f cpu + 496.125 set information library 75/f cpu + 79157.6875 75/f cpu + 652400 67f cpu + 79157.6875 67f cpu + 652400 eeprom write library 318 (321)/f cpu + 799.875 318 (321)/f cpu + 1647.375 262 (265)/f cpu + 799.875 262 (265)/f cpu + 1647.375 remarks 1. values in parentheses indicate values when a write start address structure is located other than in the internal high-speed ram. 2. f cpu : cpu operation clock frequency
chapter 1 outline user?s manual u19180ej1v0ud 23 (1) conventional-specification products ( pd78f08xx) (3/3) <4> when high-speed system clock (x1 oscillation or external clock input) is used and entry ram is located in short direct addressing range processing time ( s) normal model of c compiler static model of c compiler/assembler library name min. max. min. max. self programming start library 34/f cpu initialize library 49/f cpu + 224.6875 mode check library 35/f cpu + 113.625 29/f cpu + 113.625 block blank check library 174/f cpu + 6120.9375 134/f cpu + 6120.9375 block erase library 174/f cpu + 30820.75 174/f cpu + 298675 134/f cpu + 30820.75 134/f cpu + 298675 word write library 318 (321)/f cpu + 383 318 (321)/f cpu + 1230.5 262 (265)/f cpu + 383 262 (265)/f cpu + 1230.5 block verify library 174/f cpu + 13175.4375 134/f cpu + 13175.4375 self programming end library 34/f cpu option value: 03h 171 (172)/f cpu + 171.3125 129 (130)/f cpu + 171.3125 option value: 04h 181 (182)/f cpu + 166.75 139 (140)/f cpu + 166.75 get information library option value: 05h 404 (411)/f cpu + 231.875 362 (369)/f cpu + 231.875 set information library 75/f cpu + 78884.5625 75/f cpu + 527566.875 67/f cpu + 78884.5625 67/f cpu + 527566.875 eeprom write library 318 (321)/f cpu + 538.75 318 (321)/f cpu + 1386.25 262 (265)/f cpu + 538.75 262 (265)/f cpu + 1386.25 remarks 1. values in parentheses indicate values when a write start address structure is located other than in the internal high-speed ram. 2. f cpu : cpu operation clock frequency
chapter 1 outline user?s manual u19180ej1v0ud 24 (2) expanded-specification products ( pd78f08xxa) (1/3) <1> when internal high-speed osc illation clock is used and entry ram is located outside short direct addressing range processing time ( s) normal model of c compiler static model of c compiler/assembler library name min. max. min. max. self programming start library 4.0 4.5 4.0 4.5 initialize library 1105.9 1106.6 1105.9 1106.6 mode check library 905.7 906.1 904.9 905.3 block blank check library 12776.1 12778.3 12770.9 12772.6 block erase library 26050.4 349971.3 26045.3 349965.6 word write library 1180.1 + 203 w 1184.3 + 2241 w 1172.9 + 203 w 1176.3 + 2241 w block verify library 25337.9 25340.2 25332.8 25334.5 self programming end library 4.0 4.5 4.0 4.5 option value: 03h 1072.9 1075.2 1067.5 1069.1 option value: 04h 1060.2 1062.6 1054.8 1056.6 get information library option value: 05h 1023.8 1028.2 1018.3 1022.1 set information library 70265.9 759995.0 70264.9 759994.0 eeprom write library 1316.8 + 347 w 1320.9 + 2385 w 1309.0 + 347 w 1312.4 + 2385 w <2> when internal high-speed oscillation clock is used and entry ram is located in short direct addressing range processing time ( s) normal model of c compiler static model of c compiler/assembler library name min. max. min. max. self programming start library 4.0 4.5 4.0 4.5 initialize library 449.5 450.2 449.5 450.2 mode check library 249.3 249.7 248.6 248.9 block blank check library 12119.7 12121.9 12114.6 12116.3 block erase library 25344.7 349266.4 25339.6 349260.8 word write library 445.8 + 203 w 449.9 + 2241 w 438.5 + 203 w 441.9 + 2241 w block verify library 24682.7 24684.9 24677.6 24679.3 self programming end library 4.0 4.5 4.0 4.5 option value: 03h 417.6 419.8 412.1 413.8 option value: 04h 405.0 407.4 399.5 401.3 get information library option value: 05h 367.4 371.8 361.9 365.8 set information library 69569.3 759297.3 69568.3 759296.2 eeprom write library 795.1 + 347 w 799.3 + 2385 w 787.4 + 347 w 790.8 + 2385 w remarks 1. the above processing times are those when a write st art address structure is located in the internal high-speed ram and during stabilized operation of the internal high-speed oscillator (rsts = 1). 2. rsts: bit 7 of the internal oscillation mode register (rcm) 3. w: number of words in write data (1 word = 4 bytes)
chapter 1 outline user?s manual u19180ej1v0ud 25 (2) expanded-specification products ( pd78f08xxa) (2/3) <3> when high-speed system clock (x1 oscillation or external clock input) is used and entry ram is located outside short direct addressing range processing time ( s) normal model of c compiler static model of c compiler/assembler library name min. max. min. max. self programming start library 34/f cpu initialize library 55/f cpu + 594 mode check library 36/f cpu + 495 30/f cpu + 495 block blank check library 179/f cpu + 6429 136/f cpu + 6429 block erase library 179/f cpu + 19713 179/f cpu + 268079 136/f cpu + 19713 136/f cpu + 268079 word write library 333/f cpu + 647 + 136 w 333/f cpu + 647 + 1647 w 272/f cpu + 647 + 136 w 272/f cpu + 647 + 1647 w block verify library 179/f cpu + 13284 136/f cpu + 13284 self programming end library 34/f cpu option value: 03h 180/f cpu + 581 134f cpu + 581 option value: 04h 190/f cpu + 574 144/f cpu + 574 get information library option value: 05h 350/f cpu + 535 304/f cpu + 535 set information library 80/f cpu + 43181 80/f cpu + 572934 72/f cpu + 43181 72/f cpu + 572934 eeprom write library 333/f cpu + 729 + 209 w 333/f cpu + 729 + 1722 w 268/f cpu + 729 + 209 w 268/f cpu + 729 + 1722 w remarks 1. the above processing times are those when a write st art address structure is located in the internal high-speed ram and during stabilized operation of the internal high-speed oscillator (rsts = 1). 2. rsts: bit 7 of the internal oscillation mode register (rcm) 3. f cpu : cpu operation clock frequency 4. w: number of words in write data (1 word = 4 bytes)
chapter 1 outline user?s manual u19180ej1v0ud 26 (2) expanded-specification products ( pd78f08xxa) (3/3) <4> when high-speed system clock (x1 oscillation or external clock input) is used and entry ram is located in short direct addressing range processing time ( s) normal model of c compiler static model of c compiler/assembler library name min. max. min. max. self programming start library 34/f cpu initialize library 55/f cpu + 272 mode check library 36/f cpu + 173 30/f cpu + 173 block blank check library 179/f cpu + 6108 136/f cpu + 6108 block erase library 179/f cpu + 19371 179/f cpu + 267738 136/f cpu + 19371 136/f cpu + 267738 word write library 333/f cpu + 247 + 136 w 333/f cpu + 247 + 1647 w 272/f cpu + 247 + 136 w 272/f cpu + 247 + 1647 w block verify library 179/f cpu + 12964 136/f cpu + 12964 self programming end library 34/f cpu option value: 03h 180/f cpu + 261 134/f cpu + 261 option value: 04h 190/f cpu + 254 144/f cpu + 254 get information library option value: 05h 350/f cpu + 213 304/f cpu + 213 set information library 80/f cpu + 42839 80/f cpu + 572592 72/f cpu + 42839 72/f cpu + 572592 eeprom write library 333/f cpu + 516 + 209 w 333/f cpu + 516 + 1722 w 268/f cpu + 516 + 209 w 268/f cpu + 516 + 1722 w remarks 1. the above processing times are those when a write st art address structure is located in the internal high-speed ram and during stabilized operation of the internal high-speed oscillator (rsts = 1). 2. rsts: bit 7 of the internal oscillation mode register (rcm) 3. f cpu : cpu operation clock frequency 4. w: number of words in write data (1 word = 4 bytes)
chapter 1 outline user?s manual u19180ej1v0ud 27 1.1.4 interrupt response time for self programming library (1) conventional-specification products ( pd78f08xx) (1/2) <1> when internal high-speed oscillation clock is used interrupt response time ( s (max.)) normal model of c compiler static model of c compiler/assembler library name entry ram location is outside short direct addressing range entry ram location is in short direct addressing range entry ram location is outside short direct addressing range entry ram location is in short direct addressing range block blank check library 933.6 668.6 927.9 662.9 block erase library 1026.6 763.6 1020.9 757.9 word write library 2505.8 1942.8 2497.8 1934.8 block verify library 958.6 693.6 952.9 687.9 set information library 476.5 211.5 475.5 210.5 eeprom write library 2760.8 2168.8 2759.5 2167.5 remarks 1. the above interrupt response times are those duri ng stabilized operation of the internal high-speed oscillator (rsts = 1). 2. rsts: bit 7 of the internal oscillation mode register (rcm) <2> when high-speed system clock is used (normal model of c compiler) interrupt response time ( s (max.)) rstop = 0, rsts = 1 rstop = 1 library name entry ram location is outside short direct addressing range entry ram location is in short direct addressing range entry ram location is outside short direct addressing range entry ram location is in short direct addressing range block blank check library 179/f cpu + 507 179/f cpu + 407 179/f cpu + 1650 179/f cpu + 714 block erase library 179/f cpu + 559 179/f cpu + 460 179/f cpu + 1702 179/f cpu + 767 word write library 333/f cpu + 1589 333/f cpu + 1298 333/f cpu + 2732 333/f cpu + 1605 block verify library 179/f cpu + 518 179/f cpu + 418 179/f cpu + 1661 179/f cpu + 725 set information library 80/f cpu + 370 80/f cpu + 165 80/f cpu + 1513 80/f cpu + 472 29/f cpu + 1759 29/f cpu + 1468 29/f cpu + 1759 29/f cpu + 1468 eeprom write library note 333/f cpu + 834 333/f cpu + 512 333/f cpu + 2061 333/f cpu + 873 note the longer value of the eeprom write library interr upt response time becomes the max. value, depending on the value of f cpu . remarks 1. f cpu : cpu operation clock frequency 2. rstop: bit 0 of the internal oscillation mode register (rcm) 3. rsts: bit 7 of the internal oscillation mode register (rcm)
chapter 1 outline user?s manual u19180ej1v0ud 28 (1) conventional-specification products ( pd78f08xx) (2/2) <3> when high-speed system clock is used (static model of c compiler/assembler) interrupt response time ( s (max.)) rstop = 0, rsts = 1 rstop = 1 library name entry ram location is outside short direct addressing range entry ram location is in short direct addressing range entry ram location is outside short direct addressing range entry ram location is in short direct addressing range block blank check library 136/f cpu + 507 136/f cpu + 407 136/f cpu + 1650 136/f cpu + 714 block erase library 136/f cpu + 559 136/f cpu + 460 136/f cpu + 1702 136/f cpu + 767 word write library 272/f cpu + 1589 272/f cpu + 1298 272/f cpu + 2732 272/f cpu + 1605 block verify library 136/f cpu + 518 136/f cpu + 418 136/f cpu + 1661 136/f cpu + 725 set information library 72/f cpu + 370 72/f cpu + 165 72/f cpu + 1513 72/f cpu + 472 19/f cpu + 1759 19/f cpu + 1468 19/f cpu + 1759 19/f cpu + 1468 eeprom write library note 268/f cpu + 834 268/f cpu + 512 268/f cpu + 2061 268/f cpu + 873 note the longer value of the eeprom write library interr upt response time becomes the max. value, depending on the value of f cpu . remarks 1. f cpu : cpu operation clock frequency 2. rstop: bit 0 of the internal oscillation mode register (rcm) 3. rsts: bit 7 of the internal oscillation mode register (rcm)
chapter 1 outline user?s manual u19180ej1v0ud 29 (2) expanded-specification products ( pd78f08xxa) (1/2) <1> when internal high-speed oscillation clock is used interrupt response time ( s (max.)) normal model of c compiler static model of c compiler/assembler library name entry ram location is outside short direct addressing range entry ram location is in short direct addressing range entry ram location is outside short direct addressing range entry ram location is in short direct addressing range block blank check library 1100.9 431.9 1095.3 426.3 block erase library 1452.9 783.9 1447.3 778.3 word write library 1247.2 579.2 1239.2 571.2 block verify library 1125.9 455.9 1120.3 450.3 set information library 906.9 312.0 905.8 311.0 eeprom write library 1215.2 547.2 1213.9 545.9 remarks 1. the above interrupt response times are those duri ng stabilized operation of the internal high-speed oscillator (rsts = 1). 2. rsts: bit 7 of the internal oscillation mode register (rcm) <2> when high-speed system clock is used (normal model of c compiler) interrupt response time ( s (max.)) rstop = 0, rsts = 1 rstop = 1 library name entry ram location is outside short direct addressing range entry ram location is in short direct addressing range entry ram location is outside short direct addressing range entry ram location is in short direct addressing range block blank check library 179/f cpu + 567 179/f cpu + 246 179/f cpu + 1708 179/f cpu + 569 block erase library 179/f cpu + 780 179/f cpu + 459 179/f cpu + 1921 179/f cpu + 782 word write library 333/f cpu + 763 333/f cpu + 443 333/f cpu + 1871 333/f cpu + 767 block verify library 179/f cpu + 580 179/f cpu + 259 179/f cpu + 1721 179/f cpu + 582 set information library 80/f cpu + 456 80/f cpu + 200 80/f cpu + 1598 80/f cpu + 459 29/f cpu + 767 29/f cpu + 447 29/f cpu + 767 29/f cpu + 447 eeprom write library note 333/f cpu + 696 333/f cpu + 376 333/f cpu + 1838 333/f cpu + 700 note the longer value of the eeprom write library interr upt response time becomes the max. value, depending on the value of f cpu . remarks 1. f cpu : cpu operation clock frequency 2. rstop: bit 0 of the internal oscillation mode register (rcm) 3. rsts: bit 7 of the internal oscillation mode register (rcm)
chapter 1 outline user?s manual u19180ej1v0ud 30 (2) expanded-specification products ( pd78f08xxa) (2/2) <3> when high-speed system clock is used (static model of c compiler/assembler) interrupt response time ( s (max.)) rstop = 0, rsts = 1 rstop = 1 library name entry ram location is outside short direct addressing range entry ram location is in short direct addressing range entry ram location is outside short direct addressing range entry ram location is in short direct addressing range block blank check library 136/f cpu + 567 136/f cpu + 246 136/f cpu + 1708 136/f cpu + 569 block erase library 136/f cpu + 780 136/f cpu + 459 136/f cpu + 1921 136/f cpu + 782 word write library 272/f cpu + 763 272/f cpu + 443 272/f cpu + 1871 272/f cpu + 767 block verify library 136/f cpu + 580 136/f cpu + 259 136/f cpu + 1721 136/f cpu + 582 set information library 72/f cpu + 456 72/f cpu + 200 72/f cpu + 1598 72/f cpu + 459 19/f cpu + 767 19/f cpu + 447 19/f cpu + 767 19/f cpuv + 447 eeprom write library note 268/f cpu + 696 268/f cpu + 376 268/f cpu + 1838 268/f cpu + 700 note the longer value of the eeprom write library interr upt response time becomes the max. value, depending on the value of f cpu . remarks 1. f cpu : cpu operation clock frequency 2. rstop: bit 0 of the internal oscillation mode register (rcm) 3. rsts: bit 7 of the internal oscillation mode register (rcm)
chapter 1 outline user?s manual u19180ej1v0ud 31 1.2 features { minimum instruction execution time can be changed from high speed (0.1 s: @ 20 mhz operation with high- speed system clock) to ultra low-speed (122 s: @ 32.768 khz operation with subsystem clock) { general-purpose register: 8 bits 32 registers (8 bits 8 registers 4 banks) { rom (flash memory), ram capacities 78k0/fc2 78k0/fe2 78k0/ff2 rom note high-speed ram note expansion ram note 44 pisn 48 pins 64 pins 80 pins 128 kb 1 kb 6 kb ? pd78f0895a pd78f0890a pd78f0893a 96 kb 4 kb ? pd78f0894a pd78f0889a pd78f0892a 60 kb pd78f0883a pd78f0886a pd78f0888a pd78f0891a 48 kb 2 kb pd78f0882a pd78f0885a pd78f0887a ? 32 kb 1 kb pd78f0881a pd78f0884a ? ? note the internal flash memory, internal high-speed ram capacities, and internal expansion ram capacities can be changed using the internal memory size switching register (ims) and the internal expansion ram size switching register (ixs) . for ims and ixs, see 24.1 internal memory size switching register and 24.2 internal expansion ram size switching register . { on-chip single-power-supply flash memory { self-programming (with boot swap function) { on-chip debug function { on-chip power-on-clear (poc) circuit and low-voltage detector (lvi) { short startup is possible via the cpu default star t using the on-chip internal high-speed oscillator { on-chip watchdog timer (operable with on-chip internal low-speed oscillator clock) { on-chip 10-bit resolution a/d converter { on-chip multiplier/divider, clock out put/buzzer output controller, i/o ports, timer, serial interface, and can controller { supply voltage: v dd = 2.7 to 5.5 v when 20 mhz, v dd = 1.8 to 5.5 v when 5 mhz (with internal high-speed oscillator clock or subsystem clock: v dd = 1.8 to 5.5 v) { operating ambient temperature: t a = ? 40 to +85 c, ? 40 to +125 c note select either of the functions of these alternate-function pins. caution the 78k0/fx2 microcontrollers have an on-chip debug function, whic h is provided for development and evaluation. do not use the on- chip debug function in products designated for mass production, because the guaranteed number of rewritable times of the flash memory may be exceeded when this function is u sed, and product reliabilit y therefore cannot be guaranteed. nec electronics is not liable fo r problems occurring when the on-chip debug function is used.
chapter 1 outline user?s manual u19180ej1v0ud 32 1.3 applications { automotive electrical appliances (body c ontrol, door control, front light control) { industrial equipment (industria l robot, building control) 1.4 ordering information [part number] pd78f08xy a xx x - xxx - g lead- free semiconductor -g product contains no lead in any area (terminal finish is ni/pd/au plating) special (t a = ? 40 to + 85 c) quality grade a a expanded-specification products product type f flash memory version product type 88y, 89y (fc2) 88y, 89y (fe2) 89y (ff2) gb-gaf 44-pin plastic lqfp (10x10) ga-gam 48-pin plastic lqfp (fine pitch) (7x7) gb-gah 64-pin plastic lqfp (fine pitch) (10x10) gc-gad 80-pin plastic lqfp (14x14) gk-gak 80-pin plastic lqfp (fine pitch) (12x12) gk-gaj 64-pin plastic lqfp (12x12) package type 881, 884 882, 885, 887 883, 886, 888, 891 889, 892, 894 890, 893, 895 1 kb 1 kb 1 kb 1 kb 1 kb 1 kb 2 kb 4 kb 6 kb 32 kb 48 kb 60 kb 96 kb 128 kb high-speed ram capacity expansion ram capacity flash memory capacity 2 kb special (t a = ? 40 to + 125 c) a2 please refer to "quality grades on nec semiconductor devices" (document no. c11531e) published by nec corporation to know the specification of quality grade on the devices and its recommended applications.
chapter 1 outline user?s manual u19180ej1v0ud 33 [list of part number] 78k0/fx2 microcontrollers package part number 44-pin plastic lqfp (10x10) pd78f0881agba-gaf-g, 78f0882agba-gaf-g, 78f0883agba-gaf-g, 78f0881agba2-gaf-g, 78f0882ag ba2-gaf-g, 78f0883a gba2-gaf-g 78k0/fc2 48-pin plastic lqfp (fine pitch) (7x7) pd78f0884agaa-gam-g, 78f0885ag aa-gam-g, 78f0886agaa-gam-g, 78f0894agaa-gam-g, 78f0895agaa- gam-g, 78f0884agaa2-gam-g, 78f0885agaa2-gam-g, 78f0886ag aa2-gam-g, 78f0894agaa2-gam-g, 78f0895agaa2-gam-g 64-pin plastic lqfp (12x12) pd78f0887agka-gaj-g, 78f0888agka- gaj-g, 78f0889agka-gaj-g, 78f0890agka-gaj-g, 78f0887agka2 -gaj-g, 78f0888agka2-gaj-g, 78f0889agka2-gaj-g, 78f 0890agka2-gaj-g 78k0/fe2 64-pin plastic lqfp (fine pitch) (10x10) pd78f0887agba-gah-g, 78f0888agba- gah-g, 78f0889agba-gah-g, 78f0890agba-gah-g, 78f0887ag ba2-gah-g, 78f0888agba2-gah-g, 78f0889agba2-gah-g, 78f 0890agba2-gah-g 80-pin plastic lqfp (14x14) pd78f0891agca-gad-g, 78f0892agca-gad-g, 78f0893agca-gad-g, 78f0891agca2-gad-g, 78f0892agc a2-gad-g, 78f0893agca2-gad-g 78k0/ff2 80-pin plastic lqfp (fine pitch) (12x12) pd78f0891agka-gak-g, 78f0892agka- gak-g, 78f0893agka-gak-g, 78f0891agka2-gak-g, 78f0892ag ka2-gak-g, 78f0893agka2-gak-g remark all these products are lead free products.
chapter 1 outline user?s manual u19180ej1v0ud 34 1.5 pin configuration (top view) 1.5.1 78k0/fc2 ? 44-pin plastic lqfp (10x10) p41 p40 reset p124/xt2/exclks p123/xt1 flmd0 p122/x2/exclk p121/x1 regc v ss /ev ss v dd /ev dd av ss av ref p10/sck10/txd61 p11/si10/rxd61 p12/so10 p13/txd60 p14/rxd60 p15/toh0 p16/toh1/intp5 p17/ti50/to50 p30/intp1 1 2 3 4 5 6 7 8 9 10 11 33 32 31 30 29 28 27 26 25 24 23 44 43 42 41 40 39 38 37 36 35 34 p120/intp0/exlvi p00/ti000 p01/ti010/to00 p80/ani0 p81/ani1 p82/ani2 p83/ani3 p84/ani4 p85/ani5 p86/ani6 p87/ani7 12 13 14 15 16 17 18 19 20 21 22 p60 p61 p62 p33/ti51/to51/intp4 p130 p73/buz/intp7 p72/pcl/intp6 p71/crxd p70/ctxd p32/intp3 p31/intp2 cautions 1. make av ss the same potential as v ss /ev ss . 2. connect the regc pin to v ss via a capacitor (0.47 to 1 f: recommended). 3. ani0/p80 to ani7/p87 ar e set in the analog input mode after release of reset. remark for pin identification, see 1.6 pin identification .
chapter 1 outline user?s manual u19180ej1v0ud 35 ? 48-pin plastic lqfp (fine pitch) (7x7) p120/intp0/exlvi p41 p40 reset p124/xt2/exclks p123/xt1 flmd0 p122/x2/exclk p121/x1 regc v ss /ev ss v dd /ev dd 1 2 3 4 5 6 7 8 9 10 11 12 36 35 34 33 32 31 30 29 28 27 26 25 48 47 46 45 44 43 42 41 40 39 38 37 p131 p00/ti000 p01/ti010/to00 p80/ani0 p81/ani1 p82/ani2 p83/ani3 p84/ani4 p85/ani5 p86/ani6 p87/ani7 p90/ani8 13 14 15 16 17 18 19 20 21 22 23 24 p60 p61 p62 p63 p33/ti51/to51/intp4 p130 p73/buz/intp7 p72/pcl/intp6 p71/crxd p70/ctxd p06/ti011/to01 p32/intp3 av ss av ref p10/sck10/txd61 p11/si10/rxd61 p12/so10 p13/txd60 p14/rxd60 p15/toh0 p16/toh1/intp5 p17/ti50/to50 p30/intp1 p31/intp2 cautions 1. make av ss the same potential as v ss /ev ss . 2. connect the regc pin to v ss via a capacitor (0.47 to 1 f: recommended). 3. ani0/p80 to ani7/p87 ar e set in the analog input mode after release of reset. remark for pin identification, see 1.6 pin identification .
chapter 1 outline user?s manual u19180ej1v0ud 36 1.5.2 78k0/fe2 ? 64-pin plastic lqfp (12x12) ? 64-pin plastic lqfp (fine pitch) (10x10) p120/intp0/exlvi p43 p42 p41 p40 reset p124/xt2/exclks p123/xt1 flmd0 p122/x2/exclk p121/x1 regc v ss ev ss v dd ev dd av ss av ref p10/sck10/txd61 p11/si10/rxd61 p12/so10 p13/txd60 p14/rxd60 p15/toh0 p16/toh1/intp5 p17/ti50/to50 p30/intp1 p53 p52 p51 p50 p31/ti002/intp2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 p60 p61 p62 p63 p33/ti51/to51/intp4 p130 p76/sck11 p75/si11 p74/so11 p73/buz/intp7 p72/pcl/intp6 p71/crxd p70/ctxd p06/ti011/to01 p05/ssi11/ti001 p32/ti012/to02/intp3 p131/ti003 p132/ti013/to03 p00/ti000 p01/ti010/to00 p80/ani0 p81/ani1 p82/ani2 p83/ani3 p84/ani4 p85/ani5 p86/ani6 p87/ani7 p90/ani8 p91/ani9 p92/ani10 p93/ani11 cautions 1. make av ss the same potential as v ss . 2. make ev dd the same potential as v dd . 3. connect the regc pin to v ss via a capacitor (0.47 to 1 f: recommended). 4. ani0/p80 to ani11/p93 are set in the analog input mode after release of reset. remark for pin identification, see 1.6 pin identification .
chapter 1 outline user?s manual u19180ej1v0ud 37 1.5.3 78k0/ff2 ? 80-pin plastic lqfp (14x14) ? 80-pin plastic lqfp (fine pitch) (12x12) p120/intp0/exlvi p47 p46 p45 p44 p43 p42 p41 p40 reset p124/xt2/exclks p123/xt1 flmd0 p122/x2/exclk p121/x1 regc v ss ev ss v dd ev dd av ss av ref p57 p56 p55 p54 p10/sck10/txd61 p11/si10/rxd61 p12/so10 p13/txd60 p14/rxd60 p15/toh0 p16/toh1/intp5 p17/ti50/to50 p30/intp1 p53 p52 p51 p50 p31/ti002/intp2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 p60 p61 p62 p63 p33/ti51/to51/intp4 p64 p65 p66 p67 p130 p76/sck11 p75/si11 p74/so11 p73/buz/intp7 p72/pcl/intp6 p71/crxd p70/ctxd p06/ti011/to01 p05/ssi11/ti001 p32//ti012/to02/intp3 p131/ti003 p132/ti013/to03 p00/ti000 p01/ti010/to00 p80/ani0 p81/ani1 p82/ani2 p83/ani3 p84/ani4 p85/ani5 p86/ani6 p87/ani7 p90/ani8 p91/ani9 p92/ani10 p93/ani11 p94/ani12 p95/ani13 p96/ani14 p97/ani15 cautions 1. make av ss the same potential as v ss . 2. make ev dd the same potential as v dd . 3. connect the regc pin to v ss via a capacitor (0.47 to 1 f: recommended). 4. ani0/p80 to ani15/p97 are set in the analog input mode after release of reset. remark for pin identification, see 1.6 pin identification .
chapter 1 outline user?s manual u19180ej1v0ud 38 1.6 pin identification ani0 to ani15: analog input av ref : analog reference voltage av ss : analog ground buz: buzzer output crxd: receive data for can ctxd: transmit data for can ev dd : power supply for port ev ss : ground for port exclk: external clock input (main system clock) exclks: external clock input (subsystem clock) exlvi: external potential input for low-voltage detector flmd0: flash programming mode intp0 to intp7: external interrupt input p00, p01, p05, p06 : port 0 p10 to p17: port 1 p30 to p33: port 3 p40 to p47: port 4 p50 to p57: port 5 p60 to p67: port 6 p70 to p76: port 7 p80 to p87: port 8 p90 to p97: port 9 p120 to p124: port 12 p130 to p132: port 13 pcl: programmable clock output regc: regulator capacitance reset: reset rxd60, rxd61: receive data sck10, sck11: serial clock input/output si10, si11: serial data input so10, so11: serial data output ssi11: serial interface chip select input ti000, ti010, ti001, ti011, ti002, ti012, ti003, ti013, ti50, ti51: timer input to00, to01, to02, to03 to50, to51, toh0, toh1: timer output txd60, txd61: transmit data v dd : power supply v ss : ground x1, x2: crystal oscillator (high-speed system clock) xt1, xt2: crystal oscillator (subsystem clock)
chapter 1 outline user?s manual u19180ej1v0ud 39 1.7 block diagram 1.7.1 78k0/fc2 ? pd78f0881a, 78f0882a, 78f0883a port 0 p00, p01 2 port 3 p30-p33 4 internal high-speed ram v ss , ev ss flmd0 v dd , ev dd port 1 p10-p17 8 multiplier/divider reset control port 4 p40, p41 2 port 6 p60-p62 3 port 7 p70-p73 4 port 8 p80-p87 8 port 12 p120-p124 5 port 13 buzzer output buz/p73 system control reset x1/p121 x2/exclk/p122 xt1/p123 xt2/exclks/p124 exlvi/p120 clock output control pcl/p72 power on clear/ low voltage indicator poc/lvi control internal expansion ram 16-bit timer/ event counter 00 to00/ti010/p01 ti000/p00 (linsel) serial interface csi10 si10/p11 so10/p12 sck10/p10 ani0/p80-ani7/p87 interrupt control 8-bit timer h0 toh0/p15 8-bit timer h1 toh1/p16 ti50/to50/p17 8-bit timer/ event counter 50 8 a/d converter rxd60/p14 rxd60/p14 (linsel) txd60/p13 serial interface uart60 rxd61/p11 txd61/p10 serial interface uart61 av ref av ss intp1/p30- intp4/p33 4 intp0/p120 (linsel) ti51/to51/p33 8-bit timer/ event counter 51 watch timer intp5/p16 intp6/p72 intp7/p73 2 78k/0 cpu core flash memory on-chip debugger crxd/p71 ctxd/p70 can p130 rxd60/p14 (linsel) 16-bit timer/ event counter 01 linsel watchdog timer low-speed internal oscillator high-speed internal oscillator
chapter 1 outline user?s manual u19180ej1v0ud 40 ? pd78f0884a, 78f0885a, 78f08 86a, 78f0894a, 78f0895a port 0 p00, p01, p06 3 port 3 p30-p33 4 internal high-speed ram v ss , ev ss flmd0 v dd , ev dd port 1 p10-p17 8 multiplier/divider reset control port 4 p40, p41 2 port 6 p60-p63 4 port 7 p70-p73 4 port 8 p80-p87 8 port 9 p90 port 12 p120-p124 5 port 13 p131 buzzer output buz/p73 system control reset x1/p121 x2/exclk/p122 xt1/p123 xt2/exclks/p124 exlvi/p120 clock output control pcl/p72 power on clear/ low voltage indicator poc/lvi control internal expansion ram 16-bit timer/ event counter 00 to00/ti010/p01 ti000/p00 (linsel) serial interface csi10 si10/p11 so10/p12 sck10/p10 ani0/p80-ani7/p87, ani8/p90 interrupt control 8-bit timer h0 toh0/p15 8-bit timer h1 toh1/p16 ti50/to50/p17 8-bit timer/ event counter 50 9 a/d converter rxd60/p14 rxd60/p14 (linsel) txd60/p13 serial interface uart60 rxd61/p11 txd61/p10 serial interface uart61 av ref av ss intp1/p30- intp4/p33 4 intp0/p120 (linsel) ti51/to51/p33 8-bit timer/ event counter 51 watch timer intp5/p16 intp6/p72 intp7/p73 2 78k/0 cpu core flash memory on-chip debugger crxd/p71 ctxd/p70 can p130 rxd60/p14 (linsel) 16-bit timer/ event counter 01 to01/ti011/p06 linsel watchdog timer low-speed internal oscillator high-speed internal oscillator bank
chapter 1 outline user?s manual u19180ej1v0ud 41 1.7.2 78k0/fe2 port 0 p00, p01, p05, p06 4 port 3 p30-p33 4 internal high-speed ram v ss , ev ss flmd0 v dd , ev dd port 1 p10-p17 8 multiplier/divider reset control port 4 p40-p43 4 port 6 p60-p63 4 port 7 p70-p76 7 port 8 p80-p87 8 port 9 p90-p93 4 port 12 p120-p124 5 port 5 p50-p53 4 port 13 p131, p132 2 buzzer output buz/p73 system control reset x1/p121 x2/exclk/p122 xt1/p123 xt2/exclks/p124 exlvi/p120 clock output control pcl/p72 power on clear/ low voltage indicator poc/lvi control internal expansion ram 16-bit timer/ event counter 00 to00/ti010/p01 ti000/p00 (linsel) serial interface csi10 si10/p11 so10/p12 sck10/p10 ani0/p80-ani7/p87 ani8/p90-ani11/p93 interrupt control 8-bit timer h0 toh0/p15 8-bit timer h1 toh1/p16 ti50/to50/p17 8-bit timer/ event counter 50 12 a/d converter rxd60/p14 rxd60/p14 (linsel) txd60/p13 serial interface uart60 watchdog timer rxd61/p11 txd61/p10 serial interface uart61 av ref av ss intp1/p30- intp4/p33 4 intp0/p120 (linsel) 16-bit timer/ event counter 01 to01/ti011/p06 ti001/p05 ti51/to51/p33 8-bit timer/ event counter 51 internal low-speed oscillator watch timer serial interface csi11 ssi11/p05 so11/p73 si11/p74 sck11/p75 intp5/p16 intp6/p72 intp7/p73 2 78k/0 cpu core flash memory on-chip debugger crxd/p71 ctxd/p70 can p130 rxd60/p14 (linsel) 16-bit timer/ event counter 02 to02/ti012/p32 ti002/p31 16-bit timer/ event counter 03 to03/ti013/p132 ti003/p131 linsel internal high-speed oscillator bank
chapter 1 outline user?s manual u19180ej1v0ud 42 1.7.3 78k0/ff2 port 0 p00.p01,p05, p06 4 port 3 p30 to p33 4 internal high-speed ram v ss , ev ss flmd0 v dd , ev dd port 1 p10 to p17 8 multiplier/divider reset control port 4 p40 to p47 8 port 6 p60 to p67 8 port 7 p70 to p76 7 port 8 p80 to p87 8 port 9 p90 to p97 8 port 12 p120 to p124 5 port 5 p50 to p57 8 port 13 p131, p132 2 buzzer output buz/p73 system control reset x1/p121 x2/exclk/p122 xt1/p123 xt2/exclks/p124 exlvi/p120 clock output control pcl/p72 power on clear/ low voltage indicator poc/lvi control internal expansion ram 16-bit timer/ event counter 00 to00/ti010/p01 ti000/p00 (linsel) serial interface csi10 si10/p11 so10/p12 sck10/p10 ani0/p80 to ani7/p87 ani8/p90 to ani15/p97 interrupt control 8-bit timer h0 toh0/p15 8-bit timer h1 toh1/p16 ti50/to50/p17 8-bit timer/ event counter 50 16 a/d converter rxd60/p14 rxd60/p14 (linsel) txd60/p13 serial interface uart60 rxd61/p11 txd61/p10 serial interface uart61 av ref av ss intp1/p30 to intp4/p33 4 intp0/p120 (linsel) 16-bit timer/ event counter 01 to01/ti011/p06 ti001/p05 ti51/to51/p33 8-bit timer/ event counter 51 watch timer serial interface csi11 ssi11/p05 so11/p73 si11/p74 sck11/p75 intp5/p16 intp6/p72 intp7/p73 2 78k/0 cpu core flash memory on-chip debugger crxd/p71 ctxd/p70 can p130 rxd60/p14 (linsel) 16-bit timer/ event counter 02 to02/ti012/p32 ti002/p31 16-bit timer/ event counter 03 to03/ti013/p132 ti003/p131 linsel watchdog timer internal low-speed oscillator internal high-speed oscillator bank
chapter 1 outline user?s manual u19180ej1v0ud 43 1.8 outline of functions (1/2) 78k0/fc2 ( pd78f088ya, 78f0894a, 78f0895a: y = 1 to 6) 78k0/fx2 item 44 pins 48 pins flash memory (kb) note 1 32 48 60 32 48 60 96 128 high-speed ram (kb) 1 expansion ram (kb) 1 2 2 1 2 2 4 6 bank (flash memory) ? 4 6 power supply voltage (a) grade products: v dd = 1.8 to 5.5 v, (a2) grade products: v dd = 2.7 to 5.5 v regulator provided minimum instruction execution time 0.1 s (20 mhz: v dd = 2.7to 5.5 v)/0.4 s (5 mhz: v dd = 1.8 to 5.5 v) note 2 high-speed system 4 to 20 mhz: v dd = 2.7 to 5.5 v/4 to 5 mhz: v dd = 1.8 to 5.5 v note 2 main internal high-speed oscillation 8 mhz (typ.): v dd = 2.7 to 5.5 v note 2 subsystem 32.768 khz (typ.): v dd = 1.8 to 5.5 v note 2 clock internal low-speed oscillation 240 khz (typ.): v dd = 1.8 to 5.5 v note 2 total 37 41 port n-ch o.d. (6 v tolerance) 3 4 16 bits (tm0) 2 ch note 3 8 bits (tm5) 2 ch 8 bits (tmh) 2 ch watch 1 ch timer wdt 1 ch can 1 ch 3-wire csi ? lin-uart 1 ch serial interface uart/3-wire csi note 4 1 ch 10-bit a/d 8 ch 9 ch external 8 interrupt internal 22 reset pin provided poc 1.59 v 0.15 v (detection voltage is fixed) lvi the detection level of the supply voltage is selectable in 16 steps. reset wdt provided clock output/buzzer output provided multiplier/divider provided on-chip debug function provided operating ambient temperature t a = ?40 to +85 c, ?40 to +125 c notes 1. the internal flash memory capacity, internal hi gh-speed ram capacity, and internal expansion ram capacity can be changed using the internal memory size switching register (ims) and the internal expansion ram size switching register (ixs). 2. this is applicable to an expanded-specification product ( pd78f08xxa) with (a) grades. see chapter 28 electrical specifications ((a2) grade products) for products with (a2) grades. 3. since tm01 does not have the following terminal at 78k0/fc2, the function is restricted in part. pd78f0881a, 78f0882a, and 78f08 83a: ti001, ti011, to01 pd78f0884a, 78f0885a, 78f0886a , 78f0894a, and 78f0895a: ti001 4. select either of the functions of these alternate-function pins.
chapter 1 outline user?s manual u19180ej1v0ud 44 (2/2) 78k0/fe2 ( pd78f088ya, 78f0890a: y = 7 to 9) 78k0/ff2 ( pd78f089ya: y = 1 to 3) 78k0/fx2 item 64 pins 80 pins flash memory (kb) note 1 48 60 96 128 60 96 128 high-speed ram (kb) 1 expansion ram (kb) 2 2 4 6 2 4 6 bank (flash memory) ? 4 6 ? 4 6 power supply voltage (a) grade products: v dd = 1.8 to 5.5 v, (a2) grade products: v dd = 2.7 to 5.5 v regulator provided minimum instruction execution time 0.1 s (20 mhz: v dd = 2.7to 5.5 v)/0.4 s (5 mhz: v dd = 1.8 to 5.5 v) note 2 high-speed system 4 to 20 mhz: v dd = 2.7 to 5.5 v/4 to 5 mhz: v dd = 1.8 to 5.5 v note 2 main internal high-speed oscillation 8 mhz (typ.): v dd = 2.7 to 5.5 v note 2 subsystem 32.768 khz (typ.): v dd = 1.8 to 5.5 v note 2 clock internal low-speed oscillation 240 khz (typ.): v dd = 1.8 to 5.5 v note 2 total 55 71 port n-ch o.d. (6 v tolerance) 4 4 16 bits (tm0) 4 ch 8 bits (tm5) 2 ch 8 bits (tmh) 2 ch watch 1 ch timer wdt 1 ch can 1 ch 3-wire csi 1 ch lin-uart 1 ch serial interface uart/3-wire csi note 2 1 ch 10-bit a/d 12 ch 16 ch external 8 interrupt internal 27 reset pin provided poc 1.59 v 0.15 v (detection voltage is fixed) lvi the detection level of the supply voltage is selectable in 16 steps. reset wdt provided clock output/buzzer output provided multiplier/divider provided on-chip debug function provided operating ambient temperature t a = ?40 to +85 c, ?40 to +125 c notes 1. the internal flash memory capacity, internal hi gh-speed ram capacity, and internal expansion ram capacity can be changed using the internal memory size switching register (ims) and the internal expansion ram size switching register (ixs). 2. this is applicable to an expanded-specification product ( pd78f08xxa) with (a) grades. see chapter 28 electrical specifications ((a2) grade products) for products with (a2) grades. 3. select either of the functions of these alternate-function pins.
chapter 1 outline user?s manual u19180ej1v0ud 45 an outline of the timer is shown below. 16-bit timer/ event counters 00 to 03 8-bit timer/ event counters 50 and 51 8-bit timers h0 and h1 tm00 tm01 tm02 tm03 tm50 tm51 tmh0 tmh1 watch timer watchdog timer interval timer 1 ch 1 ch 1 ch 1 ch 1 ch 1 ch 1 ch 1 ch 1 channel note 1 channel operation mode external event counter 1 ch 1 ch 1 ch 1 ch 1 ch 1 ch ? ? ? ? timer output 1 1 1 1 1 1 1 1 ? ? ppg output 1 1 1 1 ? ? ? ? ? ? pwm output ? ? ? ? 1 1 1 1 ? ? pulse width measurement 2 2 2 2 ? ? ? ? ? ? square-wave output 1 1 1 1 1 1 1 1 ? ? function interrupt source 2 2 2 2 1 1 1 1 1 ? note in the watch timer, the watch timer function and in terval timer function can be used simultaneously. remarks 1. tm51 and tmh1 can be used in combination as a carrier generator mode. 2. the timer mounted depends on the product. 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 6, z = 4, 5 y = 1 to 3 y = 4 to 7 16-bit timer/event counter 00 16-bit timer/event counter 01 note 16-bit timer/event counter 02 ? 16-bit timer/event counter 03 ? 8-bit timer/event counter 50 8-bit timer/event counter 51 8-bit timer h0 8-bit timer h1 watch timer watchdog timer note since tm01 does not have the following terminal at 78k0/fc2, the function is restricted in part. pd78f0881a, 78f0882a, and 78f08 83a: ti001, ti011, to01 pd78f0884a, 78f0885a, 78f0886a, 78f0894a, and 78f0895a: ti001 : mounted, ? : not mounted
user?s manual u19180ej1v0ud 46 chapter 2 pin functions 2.1 pin function list pin i/o buffer power supplies depend on the product. the relationship between t hese power supplies and the pins is shown below. table 2-1. pin i/o buffer power supplies (av ref , ev dd /v dd ) ? 78k0/fc2: 44-pin plastic lqfp (10x10), 48-pin plastic lqfp (fine pitch) (7x7) power supply corresponding pins av ref p80 to p87, p90 note ev dd /v dd ? port pins other than p80 to p87, p90 note ? non-port pins note p90 is pd78f0884a, 78f0885a, 78f0886a, 78f 0894a and 78f0895a only. table 2-2. pin i/o buffer power supplies (av ref , ev dd , v dd ) ? 78k0/fe2: 64-pin plastic lqfp (fine pitc h) (10x10), 64-pin plastic lqfp (12x12) ? 78k0/ff2: 80-pin plastic lqfp (14x14), 80- pin plastic lqfp (fine pitch) (12x12) power supply corresponding pins av ref p80 to p87, p90 to p97 note ev dd port pins other than p80 to p87, p90 to p97 note and p121 to p124 v dd ? p121 to p124 ? non-port pins note p94 to p97 is 78k0/ff2 only.
chapter 2 pin functions user?s manual u19180ej1v0ud 47 2.1.1 78k0/fc2 (1) port pins: 78k0/fc2 table 2-3. port pins: 78k0/fc2 (1/2) pin name i/o function after reset alternate function p00 ti000 p01 ti010/to00 p06 note i/o port 0. 3-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input ti011/to01 p10 sck10/txd61 p11 si10/rxd61 p12 so10 p13 txd60 p14 rxd60 p15 toh0 p16 toh1/intp5 p17 i/o port 1. 8-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input ti50/to50 p30 intp1 p31 intp2 p32 intp3 p33 i/o port 3. 4-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input intp4/ti51/to51 p40, p41 i/o port 4. 2-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input ? p60 to p63 note i/o port 6. 4-bit i/o port input/output can be specified in 1-bit units. n-ch open drain i/o port. input ? p70 ctxd p71 crxd p72 pcl/intp6 p73 i/o port 7. 4-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input buz/intp7 p80 to p87 i/o port 8. 8-bit i/o port. input/output can be specified in 1-bit units. input ani0 to ani7 p90 note i/o port 9. 1-bit i/o port. input/output can be specified in 1-bit units. input ani8 note p06, p63, p90 are pd78f0884a, 78f0885a, 78f0886a , 78f0894a, and 78f0895a only.
chapter 2 pin functions user?s manual u19180ej1v0ud 48 table 2-3. port pins: 78k0/fc2 (2/2) pin name i/o function after reset alternate function p120 intp0/exlvi p121 x1 p122 x2/exclk p123 xt1 p124 i/o port 12. 5-bit i/o port. only for p120, use of an on-chip pull-up resistor can be specified by a software setting. input xt2/exclks p130 output output p131 note i/o port 13. p130 is 1-bit output-only port. p131 is 1-bit i/o port. p131 use of an on-chip pull-up re sistor can be specified by a software setting. input ? note p131 is pd78f0884a, 78f0885a, 78f0886a, 78f0894a, and 78f0895a only. (2) non-port pins: 78k0/fc2 table 2-4. non-port pins: 78k0/fc2 (1/2) pin name i/o function after reset alternate function intp0 p120/exlvi intp1 p30 intp2 p31 intp3 p32 intp4 p33/ti51/to51 intp5 p16/toh1 intp6 p72/pcl intp7 input external interrupt request input for which the valid edge (rising edge, falling edge, or both rising and falling edges) can be specified input p73/buz si10 input serial data input to serial interface input p11/rxd61 so10 output serial data output from serial interface input p12 sck10 i/o clock input/output for se rial interface input p10/txd61 rxd60 p14 rxd61 input serial data input to asynch ronous serial interface input p11/si10 txd60 p13 txd61 output serial data output from asyn chronous serial interface input p10/sck10 ti000 external count clock input to 16-bit timer/event counter 00 capture trigger input to captur e registers (cr000, cr010) of 16-bit timer/event counter 00 p00 ti010 capture trigger input to capture register (cr000) of 16-bit timer/event counter 00 p01/to00 ti011 input capture trigger input to capture register (cr001) of 16-bit timer/event counter 01 input p06/to01 to00 16-bit timer/event counter 00 output p01/ti010 to01 output 16-bit timer/event counter 01 output input p06/ti011 ti50 external count clock input to 8-bit timer/event counter 50 p17/to50 ti51 input external count clock input to 8-bit timer/event counter 51 input p33/to51/intp4
chapter 2 pin functions user?s manual u19180ej1v0ud 49 table 2-4. non-port pins: 78k0/fc2 (2/2) pin name i/o function after reset alternate function to50 8-bit timer/event counter 50 output p17/ti50 to51 output 8-bit timer/event counter 51 output input p33/ti51/intp4 toh0 8-bit timer h0 output p15 toh1 output 8-bit timer h1 output input p16/intp5 pcl output clock output (for trimming of high-speed system clock, subsystem clock) input p72/intp6 buz output buzzer output input p73/intp7 ani0 to ani8 note input a/d converter analog input input p80 to p87, p90 ctxd input can transmit data output input p70 crxd output can receive data input input p71 av ref input a/d converter reference voltage input and positive power supply for port 2 ? ? av ss ? a/d converter ground potential. make the same potential as ev ss or v ss . ? ? reset input system reset input ? ? x1 input input p121 x2 ? connecting resonator for hi gh-speed system clock input p122/exclk xt1 input input p123 xt2 ? connecting resonator fo r subsystem clock input p124/exclks exclk input external clock input fo r main system clock input p122/x2 exclks input external clock input for subsystem clock input p124/xt2 exlvi input potential input for external low-voltage detection input p120/intp0 v dd ? positive power suppl y (except for ports) ? ? ev dd ? positive power supply for ports ? ? v ss ? ground potential (except for ports) ? ? ev ss ? ground potential for ports ? ? flmd0 ? flash memory programming mode setting. ? ? regc ? this is the pin for connecting regulator output (2.5 v) stabilization capacitance for internal operation. connect this pin to v ss via a capacitor (0.47 to 1 f: recommended). ? ? note ani8 is pd78f0884a, 78f0885a, 78f0886a, 78f0894a, and 78f0895a only.
chapter 2 pin functions user?s manual u19180ej1v0ud 50 2.1.2 78k0/fe2 (1) port pins: 78k0/fe2 table 2-5. port pins: 78k0/fe2 (1/2) pin name i/o function after reset alternate function p00 ti000 p01 ti010/to00 p05 ssi11/ti001 p06 i/o port 0. 4-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input ti011/to01 p10 sck10/txd61 p11 si10/rxd61 p12 so10 p13 txd60 p14 rxd60 p15 toh0 p16 toh1/intp5 p17 i/o port 1. 8-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input ti50/to50 p30 intp1 p31 intp2/ti002 p32 intp3/ti012/to02 p33 i/o port 3. 4-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input intp4/ti51/to51 p40 to p43 i/o port 4. 4-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input ? p50 to p53 i/o port 5. 4-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input ? p60 to p63 i/o port 6. 4-bit i/o port input/output can be specified in 1-bit units. n-ch open drain i/o port. input ? p70 ctxd p71 crxd p72 pcl/intp6 p73 buz/intp7 p74 so11 p75 si11 p76 i/o port 7. 7-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input sck11 p80 to p87 i/o port 8. 8-bit i/o port. input/output can be specified in 1-bit units. input ani0 to ani7
chapter 2 pin functions user?s manual u19180ej1v0ud 51 table 2-5. port pins: 78k0/fe2 (2/2) pin name i/o function after reset alternate function p90 to p93 i/o port 9. 4-bit i/o port. input/output can be specified in 1-bit units. input ani8 to ani11 p120 intp0/exlvi p121 x1 p122 x2/exclk p123 xt1 p124 i/o port 12. 5-bit i/o port. only for p120, use of an on-chip pull-up resistor can be specified by a software setting. input xt2/exclks p130 output output ? p131 ti003 p132 i/o port 13. p130 is 1-bit output-only port. p131 and p132 are 2-bit i/o port. p131 and p132 use of an on-chip pull-up resistor can be specified by a software setting. input ti013/to03 (2) non-port pins: 78k0/fe2 table 2-6. non-port pins: 78k0/fe2 (1/3) pin name i/o function after reset alternate function intp0 p120/exlvi intp1 p30 intp2 p31/ti002 intp3 p32/ti012/to02 intp4 p33/ti51/to51 intp5 p16/toh1 intp6 p72/pcl intp7 input external interrupt request input for which the valid edge (rising edge, falling edge, or both rising and falling edges) can be specified input p73/buz si10 p11/rxd61 si11 input serial data input to serial interface input p75 so10 p12 so11 output serial data output from serial interface input p74 sck10 p10/txd61 sck11 i/o clock input/output for serial interface input p76 ssi11 input serial interface chip select input input p05/ti001 rxd60 p14 rxd61 input serial data input to asynch ronous serial interface input p11/si10 txd60 p13 txd61 output serial data output from asyn chronous serial interface input p10/sck10 ti000 input external count clock input to 16-bit timer/event counter 00 capture trigger input to captur e registers (cr000, cr010) of 16-bit timer/event counter 00 input p00
chapter 2 pin functions user?s manual u19180ej1v0ud 52 table 2-6. non-port pins: 78k0/fe2 (2/3) pin name i/o function after reset alternate function ti001 external count clock input to 16-bit timer/event counter 01 capture trigger input to captur e registers (cr001, cr011) of 16-bit timer/event counter 01 p05/ssi11 ti002 external count clock input to 16-bit timer/event counter 02 capture trigger input to captur e registers (cr002, cr012) of 16-bit timer/event counter 02 p31/intp2 ti003 external count clock input to 16-bit timer/event counter 03 capture trigger input to captur e registers (cr003, cr013) of 16-bit timer/event counter 03 p131 ti010 capture trigger input to capture register (cr000) of 16-bit timer/event counter 00 p01/to00 ti011 capture trigger input to capture register (cr001) of 16-bit timer/event counter 01 p06/to01 ti012 capture trigger input to capture register (cr002) of 16-bit timer/event counter 02 p32/to02/intp3 ti013 input capture trigger input to capture register (cr003) of 16-bit timer/event counter 03 input p132/to03 to00 16-bit timer/event counter 00 output p01/ti010 to01 16-bit timer/event counter 01 output p06/ti011 to02 output 16-bit timer/event counter 02 output input p32/ti012/intp3 to03 output 16-bit timer/event counter 03 output input p132/ti013 ti50 external count clock input to 8-bit timer/event counter 50 p17/to50 ti51 input external count clock input to 8-bit timer/event counter 51 input p33/to51/intp4 to50 8-bit timer/event counter 50 output p17/ti50 to51 8-bit timer/event counter 51 output p33/ti51/intp4 toh0 8-bit timer h0 output p15 toh1 output 8-bit timer h1 output input p16/intp5 pcl output clock output (for trimming of high-speed system clock, subsystem clock) input p72/intp6 buz output buzzer output input p73/intp7 ani0 to ani11 input a/d converter analog input input p80 to p87 p90 to p93 ctxd input can transmit data output input p70 crxd output can receive data input input p71 av ref input a/d converter reference voltage input and positive power supply for port 2 ? ? av ss ? a/d converter ground potential. make the same potential as ev ss or v ss . ? ? reset input system reset input ? ? x1 input input p121 x2 ? connecting resonator for hi gh-speed system clock input p122/exclk xt1 input input p123 xt2 ? connecting resonator fo r subsystem clock input p124/exclks
chapter 2 pin functions user?s manual u19180ej1v0ud 53 table 2-6. non-port pins: 78k0/fe2 (3/3) pin name i/o function after reset alternate function exclk input external clock input fo r main system clock input p122/x2 exclks input external clock input for subsystem clock input p124/xt2 exlvi input potential input for external low-voltage detection input p120/intp0 v dd ? positive power suppl y (except for ports) ? ? ev dd ? positive power supply for ports ? ? v ss ? ground potential (except for ports) ? ? ev ss ? ground potential for ports ? ? flmd0 ? flash memory programming mode setting. ? ? regc ? this is the pin for connecting regulator output (2.5 v) stabilization capacitance for internal operation. connect this pin to v ss via a capacitor (0.47 to 1 f: recommended). ? ? 2.1.3 78k0/ff2 (1) port pins: 78k0/ff2 table 2-7. port pins: 78k0/ff2 (1/2) pin name i/o function after reset alternate function p00 ti000 p01 ti010/to00 p05 ssi11/ti001 p06 i/o port 0. 4-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input ti011/to01 p10 sck10/txd61 p11 si10/rxd61 p12 so10 p13 txd60 p14 rxd60 p15 toh0 p16 toh1/intp5 p17 i/o port 1. 8-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input ti50/to50 p30 intp1 p31 intp2/ti002 p32 intp3/ti012/to02 p33 i/o port 3. 4-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input intp4/ti51/to51 p40 to p47 i/o port 4. 8-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input ? p50 to p57 i/o port 5. 8-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input ?
chapter 2 pin functions user?s manual u19180ej1v0ud 54 table 2-7. port pins: 78k0/ff2 (2/2) pin name i/o function after reset alternate function p60 to p63 n-ch open drain i/o port. p64 to p67 i/o port 6. 8-bit i/o port input/output can be specified in 1-bit units. use of an on-chip pull-up resister can be specified by a software setting input ? p70 ctxd p71 crxd p72 pcl/intp6 p73 buz/intp7 p74 so11 p75 si11 p76 i/o port 7. 7-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input sck11 p80 to p87 i/o port 8. 8-bit i/o port. input/output can be specified in 1-bit units. input ani0 to ani7 p90 to p97 i/o port 9. 8-bit i/o port. input/output can be specified in 1-bit units. input ani8 to ani15 p120 intp0/exlvi p121 x1 p122 x2/exclk p123 xt1 p124 i/o port 12. 5-bit i/o port. only for p120, use of an on-chip pull-up resistor can be specified by a software setting. input xt2/exclks p130 output output ? p131 ti003 p132 i/o port 13. p130 is 1-bit output-only port. p131 and p132 are 2-bit i/o port. p131 and p132 use of an on-chip pull-up resistor can be specified by a software setting. input ti013/to03 (2) non-port pins: 78k0/ff2 table 2-8. non-port pins: 78k0/ff2 (1/3) pin name i/o function after reset alternate function intp0 p120/exlvi intp1 p30 intp2 p31/ti002 intp3 p32/ti012/to02 intp4 p33/ti51/to51 intp5 p16/toh1 intp6 p72/pcl intp7 input external interrupt request input for which the valid edge (rising edge, falling edge, or both rising and falling edges) can be specified input p73/buz si10 p11/rxd61 si11 input serial data input to serial interface input p75
chapter 2 pin functions user?s manual u19180ej1v0ud 55 table 2-8. non-port pins: 78k0/ff2 (2/3) pin name i/o function after reset alternate function so10 p12 so11 output serial data output from serial interface input p74 sck10 p10/txd61 sck11 i/o clock input/output for serial interface input p76 ssi11 input serial interface chip select input input p05/ti001 rxd60 p14 rxd61 input serial data input to asynch ronous serial interface input p11/si10 txd60 p13 txd61 output serial data output from asyn chronous serial interface input p10/sck10 ti000 external count clock input to 16-bit timer/event counter 00 capture trigger input to captur e registers (cr000, cr010) of 16-bit timer/event counter 00 p00 ti001 external count clock input to 16-bit timer/event counter 01 capture trigger input to captur e registers (cr001, cr011) of 16-bit timer/event counter 01 p05/ssi11 ti002 external count clock input to 16-bit timer/event counter 02 capture trigger input to captur e registers (cr002, cr012) of 16-bit timer/event counter 02 p31/intp2 ti003 external count clock input to 16-bit timer/event counter 03 capture trigger input to captur e registers (cr003, cr013) of 16-bit timer/event counter 03 p131 ti010 capture trigger input to capture register (cr000) of 16-bit timer/event counter 00 p01/to00 ti011 capture trigger input to capture register (cr001) of 16-bit timer/event counter 01 p06/to01 ti012 capture trigger input to capture register (cr002) of 16-bit timer/event counter 02 p32/to02/intp3 ti013 input capture trigger input to capture register (cr003) of 16-bit timer/event counter 03 input p132/to03 to00 16-bit timer/event counter 00 output p01/ti010 to01 16-bit timer/event counter 01 output p06/ti011 to02 output 16-bit timer/event counter 02 output input p32/ti012/intp3 to03 output 16-bit timer/event counter 03 output input p132/ti013 ti50 external count clock input to 8-bit timer/event counter 50 p17/to50 ti51 input external count clock input to 8-bit timer/event counter 51 input p33/to51/intp4 to50 8-bit timer/event counter 50 output p17/ti50 to51 8-bit timer/event counter 51 output p33/ti51/intp4 toh0 8-bit timer h0 output p15 toh1 output 8-bit timer h1 output input p16/intp5 pcl output clock output (for trimming of high-speed system clock, subsystem clock) input p72/intp6 buz output buzzer output input p73/intp7 ani0 to ani15 input a/d converter analog input input p80 to p87 p90 to p97
chapter 2 pin functions user?s manual u19180ej1v0ud 56 table 2-8. non-port pins: 78k0/ff2 (3/3) pin name i/o function after reset alternate function ctxd input can transmit data output input p70 crxd output can receive data input input p71 av ref input a/d converter reference voltage input and positive power supply for port 2 ? ? av ss ? a/d converter ground potential. make the same potential as ev ss or v ss . ? ? reset input system reset input ? ? x1 input input p121 x2 ? connecting resonator for hi gh-speed system clock input p122/exclk xt1 input input p123 xt2 ? connecting resonator fo r subsystem clock input p124/exclks exclk input external clock input fo r main system clock input p122/x2 exclks input external clock input for subsystem clock input p124/xt2 exlvi input potential input for external low-voltage detection input p120/intp0 v dd ? positive power suppl y (except for ports) ? ? ev dd ? positive power supply for ports ? ? v ss ? ground potential (except for ports) ? ? ev ss ? ground potential for ports ? ? flmd0 ? flash memory programming mode setting. ? ? regc ? this is the pin for connecting regulator output (2.5 v) stabilization capacitance for internal operation. connect this pin to v ss via a capacitor (0.47 to 1 f: recommended). ? ?
chapter 2 pin functions user?s manual u19180ej1v0ud 57 2.2 description of pin functions remark the pins mounted depend on the product. see 1.4 ordering information and 2.1 pin function list . 2.2.1 p00, p01, p05, p06 (port 0) p00, p01, p05 and p06 function as a 4-bit i/o port. these pi ns also function as timer i/o and serial interface chip select input. 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 3 y = 4 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p00/ti000 p01/ti010/to00 p05/ti001/ssi11 ? ? p06/ti011/to01 ? remark : mounted, ? : not mounted the following operation modes can be specified in 1-bit units. (1) port mode p00, p01, p05 and p06 function as 4-bit i/o port. p00, p 01, p05 and p06 can be set to input or output in 1-bit units using port mode register 0 (pm0). use of an on-chip pull-up resistor can be specified by pull-up resistor option register 0 (pu0). (2) control mode p00, p01, p05 and p06 function as timer i/o, and serial interface chip select input. (a) ti000, ti001 these are the pins for inputting an external count clo ck to 16-bit timer/event counters 00 and 01 and are also for inputting a capture trigger signal to the captur e registers (cr000, cr010 or cr001, cr011) of 16-bit timer/event counters 00 and 01. (b) ti010, ti011 these are the pins for inputting a capt ure trigger signal to the capture re gister (cr000 or cr001) of 16-bit timer/event counters 00 and 01. (c) to00, to01 these are timer output pins. (d) ssi11 this is the serial interface chip select input pin.
chapter 2 pin functions user?s manual u19180ej1v0ud 58 2.2.2 p10 to p17 (port 1) p10 to p17 function as an 8-bit i/o port. t hese pins also function as pins for ex ternal interrupt re quest input, serial interface data i/o, cl ock i/o, and timer i/o. 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p10/sck10/txd61 p11/si10/rxd61 p12/so10 p13/txd60 p14/rxd60 p15/toh0 p16/toh1/intp5 p17/ti50/to50 remark : mounted the following operation modes can be specified in 1-bit units. (1) port mode p10 to p17 function as an 8-bit i/o port. p10 to p17 can be set to input or output in 1-bit units using port mode register 1 (pm1). use of an on-chip pull-up resistor can be specified by pull-up resistor option register 1 (pu1). (2) control mode p10 to p17 function as external interrupt request in put, serial interface data i/o, clock i/o, and timer i/o. (a) si10 this is a serial interface serial data input pin. (b) so10 this is a serial interface serial data output pin. (c) sck10 this is a serial interface serial clock i/o pin. (d) rxd60, rxd61 these are the serial data input pins of the asynchronous serial interface. (e) txd60, txd61 these are the serial data output pins of the asynchronous serial interface. (f) ti50 this is the pin for inputting an external c ount clock to 8-bit timer/event counter 50. (g) to50, toh0, and toh1 these are timer output pins.
chapter 2 pin functions user?s manual u19180ej1v0ud 59 (h) intp5 this is an external interrupt request input pin for whic h the valid edge (rising edge, falling edge, or both rising and falling edges) can be specified. 2.2.3 p30 to p33 (port 3) p30 to p33 function as a 4-bit i/o port. these pins also function as pins for external interrupt request input and timer i/o. 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p30/intp1 p31/intp2/ti002 p31/intp2 note 1 p32/intp3/ti012/ to02 p32/intp3 note 2 p33/intp4/ti51/ to51 notes 1. ti002 pin is not mounted. port functions other t han ti002 as well as shared functions are provided. 2. ti012, to02 pins are not mounted. port functions other than ti012 and to02 as well as shared functions are provided. remark : mounted the following operation modes can be specified in 1-bit units. (1) port mode p30 to p33 function as a 4-bit i/o port. p30 to p33 c an be set to input or output in 1-bit units using port mode register 3 (pm3). use of an on-chip pull-up resistor can be specified by pull-up resistor option register 3 (pu3). (2) control mode p30 to p33 function as external interru pt request input pins and timer i/o pins. (a) intp1 to intp4 these are the external interrupt request input pins fo r which the valid edge (rising edge, falling edge, or both rising and falling edges) can be specified. (b) ti002 this is the pin for inputting an external count clock to 16-bit timer/event counter 02 and is also for inputting a capture trigger signal to the ca pture registers (cr002, cr012) of 16-bit timer/event counter 02. (c) ti012 this is the pin for inputting a capture trigger signal to the capture register (cr002) of 16-bit timer/event counter 02. (d) to02 this is a timer output pin.
chapter 2 pin functions user?s manual u19180ej1v0ud 60 (e) ti51 this is an external count clock input pin to 8-bit timer/event counter 51. (f) to51 this is a timer output pin. cautions 1. be sure to pull the p31/ti002/intp2 pin down before a reset relea se, to prevent malfunction. 2. connect p31/ti002/intp2 as follows when wr iting the flash memory with a flash memory programmer. - p31/ti002/intp2: connect to ev ss via a resistor (10 k : recommended). the above connection is not necessary when writing the flash memory by means of self programming. remark p31/ti002/intp2 and p32/ti012/to02/in tp3 can be used as on-chip debug mode setting pins when the on-chip debug function is used. for how to c onnect an in-circuit emulator supporting on-chip debugging (qb-78k0mini or qb-mini2), see chapter 25 on-chip debug function . 2.2.4 p40 to p47 (port 4) p40 to p47 function as a 8-bit i/o port. p40 to p47 can be set to input or output in 1-bit units using port mode register 4 (pm4). use of an on-chip pull-up resistor can be specified by pull-up resistor option register 4 (pu4). 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p40 p41 p42 ? p43 ? p44 ? ? p45 ? ? p46 ? ? p47 ? ? remark : mounted, ? : not mounted
chapter 2 pin functions user?s manual u19180ej1v0ud 61 2.2.5 p50 to p57 (port 5) p50 to p57 function as a 8-bit i/o port. p50 to p57 can be set to input or output in 1-bit units using port mode register 5 (pm5). use of an on-chip pull-up resistor can be specified by pull-up resistor option register 5 (pu5). 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p50 ? p51 ? p52 ? p53 ? p54 ? ? p55 ? ? p56 ? ? p57 ? ? remark : mounted, ? : not mounted 2.2.6 p60 to p67 (port 6) p60 to p67 function as a 8-bit i/o port. p60 to p67 can be set to input port or output por t in 1-bit units using port mode register 6 (pm6). p64 to p67 use of an on-chip pu ll-up resistor can be specifie d by pull-up resistor option register 6 (pu6). p60 to p63 are n-ch open-drain pins. 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 3 y = 4 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p60 p61 p62 p63 ? p64 ? ? ? p65 ? ? ? p66 ? ? ? p67 ? ? ? remark : mounted, ? : not mounted
chapter 2 pin functions user?s manual u19180ej1v0ud 62 2.2.7 p70 to p76 (port 7) p70 to p76 function as a 7-bit i/o port. these pins also function as external interrupt request input, clock output pins, buzzer output pins, can i/f i/o, serial interface data i/o and clock i/o. 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p70/ctxd p71/crxd p72/pcl/intp6 p73/buz/intp7 p74/so11 ? p75/si11 ? p76/sck11 ? remark : mounted, ? : not mounted the following operation modes can be specified in 1-bit units. (1) port mode p70 to p76 function as a 7-bit i/o port. p70 to p76 c an be set to input or output in 1-bit units using port mode register 7 (pm7). use of an on-chip pull-up resistor can be specified by pull-up resistor option register 7 (pu7). (2) control mode p70 to p76 function as external in terrupt request input, out put pins, buzzer output pins, can i/f i/o, serial interface data i/o and clock i/o. (a) intp6, intp7 these are the external interrupt request input pins fo r which the valid edge (rising edge, falling edge, or both rising and falling edges) can be specified. (b) crxd this is the can serial receive data input pin. (c) ctxd this is the can serial transmit data output pin. (d) pcl this is a clock output pin. (e) buz this is a buzzer output pin. (f) si11 this is a serial interface serial data input pin.
chapter 2 pin functions user?s manual u19180ej1v0ud 63 (g) so11 this is a serial interface serial data output pin. (h) sck11 this is the serial interf ace serial clock i/o pin. 2.2.8 p80 to p87 (port 8) p80 to p87 function as an 8-bit i/o port. these pins also function as pins for a/d converter analog input. 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p80/ani0 p81/ani1 p82/ani2 p83/ani3 p84/ani4 p85/ani4 p86/ani6 p87/ani7 remark : mounted, ? : not mounted the following operation modes can be specified in 1-bit units. (1) port mode p80 to p87 function as an 8-bit i/o port. p80 to p87 can be set to input or output in 1-bit units using port mode register 8 (pm8). (2) control mode p80 to p87 function as a/d converter analog input pins (ani0 to ani7). when using these pins as analog input pins, see (5) p80/ani0 to p87/ani7, p90/ani8 to p97/ani15 in 13.6 cautions for a/d converter . caution p80/ani0 to p87/ani7 is set in the analog input mode after release of reset.
chapter 2 pin functions user?s manual u19180ej1v0ud 64 2.2.9 p90 to p97 (port 9) p90 to p97 function as an 8-bit i/o port. these pins also function as pins for a/d converter analog input. 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 3 y = 4 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p80/ani0 ? p81/ani1 ? ? p82/ani2 ? ? p83/ani3 ? ? p84/ani4 ? ? ? p85/ani4 ? ? ? p86/ani6 ? ? ? p87/ani7 ? ? ? remark : mounted, ? : not mounted the following operation modes can be specified in 1-bit units. (1) port mode p90 to p97 function as an 8-bit i/o port. p90 to p97 can be set to input or output in 1-bit units using port mode register 9 (pm9). (2) control mode p90 to p97 function as a/d converter analog input pins (ani8 to ani15). when using these pins as analog input pins, see (5) p80/ani0 to p87/ani7, p90/ani8 to p97/ani15 in 13.6 cautions for a/d converter . caution p90/ani8 to p97/ani15 is set in the an alog input mode after release of reset. 2.2.10 p120 to p124 (port 12) p120 to p124 function as a 5-bit i/o port. these pins also function as pins for extern al interrupt request input, external clock input for main system cl ock, external clock input for subsyste m clock and potential input for external low-voltage detection. 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p120/intp0/exlvi p121/x1 p122/x2/exclk p123/xt1 p124/xt2/exclks remark : mounted
chapter 2 pin functions user?s manual u19180ej1v0ud 65 the following operation modes can be specified in 1-bit units. (1) port mode p120 to p124 function as a 5-bit i/o port. p120 to p124 ca n be set to input or output using port mode register 12 (pm12). only for p120, use of an on-chip pull-up resistor can be specified by pull-up resistor option register 12 (pu12). (2) control mode p120 to p124 function as pins for external interrupt request input, potential input for external low-voltage detection, resonator connection for main system clock, re sonator connection for subsystem clock, external clock input for main system clock and external clock input for subsystem clock. (a) intp0 this functions as an external interrupt request input for which the valid edge (rising edge, falling edge, or both rising and falling edges) can be specified. (b) exlvi this is a potential input pin for external low-voltage detection. (c) x1, x2 these are the pins for connecting a re sonator for high-speed system clock. when supplying an external clock, input a signal to t he x1 pin and input the inverse signal to the x2 pin. caution connect p121/x1 as follows when writ ing the flash memory with a flash memory programmer. - p121/x1: when using this pin as a port, connect it to v ss via a resistor (10 k : recommended) (in the input mode) or leave it open (in the output mode). the above connection is not necessary when writing the flash memory by means of self programming. remark the x1 and x2 pins can be used as on-chip debug mode setting pins when the on-chip debug function is used. for how to connect an in-cir cuit emulator supporting on-chip debugging (qb- 78k0mini or qb-mini2), see chapter 25 on-chip debug function . (d) exclk this is an external clock inpu t pin for main system clock. (e) xt1, xt2 these are the pins for connecting a resonator for subsystem clock. when supplying an external clock, input a signal to t he xt1 pin and input the inve rse signal to the xt2 pin. (f) exclks this is an external clock in put pin for subsystem clock.
chapter 2 pin functions user?s manual u19180ej1v0ud 66 2.2.11 p130 to p132 (port 13) p130 functions as a 1-bit output-only port. p131 and p132 function as a 2-bit i/o port. these pins also function as pins for timer i/o. 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 3 y = 4 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p130 p131/ti003 ? p131 note p132/ti013/to03 ? ? note ti003 pin is not mounted. port function is provided. remark : mounted, ? : not mounted the following operation modes can be specified in 1-bit units. (1) port mode p131 and p132 can be set to input or output in 1 bit uni ts using port mode register 13 (pm13). p131 and p132 use of an on-chip pull-up resistor can be specified by pull-up resistor option register 13 (pu13). (2) control mode p130, p131 and p132 function as timer i/o and serial interface chip select input. (a) ti003 this is the pin for inputting an external count clock to 16-bit timer/event counter 03 and is also for inputting a capture trigger signal to the ca pture registers (cr003, cr013) of 16-bit timer/event counter 03. (b) ti013 this is the pin for inputting a capture trigger signal to the capture register (cr003) of 16-bit timer/event counter 03. (c) to03 this is a timer output pin. 2.2.12 av ref , av ss , v dd , ev dd , v ss and ev ss 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p120/intp0/exlvi p121/x1 p122/x2/exclk p123/xt1 p124/xt2/exclks remark : mounted
chapter 2 pin functions user?s manual u19180ej1v0ud 67 (a) av ref this is the a/d converter reference voltage input pin. when the a/d converter is not used, connect this pin directly to ev dd or v dd note . note connect port 8 and port 9 directly to ev dd when it is used as a digital port. (b) av ss this is the a/d converter ground potent ial pin. even when the a/d converte r is not used, always use this pin with the same potential as the ev ss pin or v ss pin. (c) v dd , ev dd v dd is the positive power supply pin for other than ports. ev dd is the positive power supply pin for ports. (d) v ss , ev ss v ss is the ground potential pin for other than ports. ev ss is the ground potential pin for ports. 2.2.13 reset this is the active-low system reset input pin. 2.2.14 regc this is the pin for connecting regulator output (2.5 v) st abilization capacitance for internal operation. connect this pin to v ss via a capacitor (0.47 to 1 f: recommended). regc v ss caution keep the wiring length as short as possible for the broken- line part in the above figure. 2.2.15 flmd0 this is a pin for setting flash memory programming mode. connect to ev ss or v ss in the normal operation mode. in flash memory programming mode, be sure to connect this pin to the flash memory programmer.
chapter 2 pin functions user?s manual u19180ej1v0ud 68 2.3 pin i/o circuits and recomme nded connection of unused pins table 2-9 shows the types of pin i/o circuits and the recommended connections of unused pins. refer to figure 2-1 for the configurat ion of the i/o circuit of each type. remark the pins mounted depend on the product. see 1.4 ordering information (top view) and 2.1 pin function list . table 2-9. pin i/o circuit types (1/2) notes 1. ?5-h? type: 78k0/fc2 ?5-ag? type: 78k0/fe2 and 78k0/ff2 2. connect p31/ti002/intp2 as follows when writing the flash memory with a flash memory programmer. - p31/ti002/intp2: connect to ev ss via a resistor (10 k : recommended). the above connection is not necessary when writing the flash memory by means of self programming. pin name i/o circuit type i/o recommended connection of unused pins p00/ti000 p01/ti010/to00 p05/ssi11/ti001 p06/ti011/to01 p10/sck10/txd61 p11/si10/rxd61 5-ah p12/so10 p13/txd60 note 1 p14/rxd60 5-ah p15/toh0 note 1 p16/toh1/intp5 p17/ti50/to50 p30/intp1 p31/ti002/intp2 note 2 p32/ti012/to02/intp3 p33/ti51/to51/intp4 5-ah p40, p41 note 1 p42 to p47 p50 to p57 5-h input: independently connect to ev dd or ev ss via a resistor. output: leave open. p60 to p63 13-p input: connect to ev ss . output: leave this pin open at low-level output after clearing the output latch of the port to 0. p64 to p67 5-ag i/o input: independently connect to ev dd or ev ss via a resistor. output: leave open.
chapter 2 pin functions user?s manual u19180ej1v0ud 69 table 2-9. pin i/o circuit types (2/2) pin name i/o circuit type i/o recommended connection of unused pins p70/ctxd note 1 p71/crxd p72/pcl/intp6 p73/buz/intp7 5-ah p74/so11 5-ag p75/si11 p76/sck11 5-ah p80/ani0 to p87/ani7 note 2 p90/ani8 to p97/ani15 note 2 11-g i/o connect to av ref or av ss . input: independently connect to ev dd or ev ss via a resistor. output: leave open. p120/intp0/exlvi 5-ah i/o input: independently connect to ev dd or ev ss via a resistor. output: leave open. p121/x1 note 3, 4 p122/x2/exclk note 3 p123/xt1 note 3 p124/xt2/exclks note 3 37 i/o input: independently connect to ev dd or ev ss via a resistor. output: leave open. p130 3-c output leave open. p131/ti003 p132/ti013/to03 5-ah i/o input: independently connect to ev dd or ev ss via a resistor. output: leave open. reset 2 input connect directly to v dd or via a resistor. av ref connect directly to ev dd or v dd note 5 . av ss connect directly to ev ss or v ss . flmd0 ? ? connect to ev ss or v ss . notes 1. ?5-h? type: 78k0/fc2 ?5-ag? type: 78k0/fe2 and 78k0/ff2 2. p80/ani0 to p87/ani7 and p90/ani8 to p97/ani15 are set in the analog input mode after release of reset. 3. use the recommended connection above in i/o port mode (see figure 6-6 format of clock operation mode select register (oscctl) ) when these pins are not used. 4. connect p121/x1 as follows when writi ng the flash memory with a flash memory programmer. - p121/x1: when using this pin as a port, connect it to v ss via a resistor (10 k : recommended) (in the input mode) or leave it open (in the output mode). the above connection is not necessary when writing the flash memory by means of self programming. 5. connect port 8 and port 9 directly to ev dd when it is used as a digital port.
chapter 2 pin functions user?s manual u19180ej1v0ud 70 figure 2-1. pin i/o circuit list (1/2) type 3-c type 2 schmitt-triggered input with hysteresis characteristics in ev dd p-ch n-ch data out vss0 type 11-g data output disable av ref p-ch in/out n-ch p-ch n-ch av ref (threshold voltage) comparator input enable + _ av ss av ss type 5-ag type 5-ah type 5-h pullup enable output data output disable input enable ev dd p-ch ev dd p-ch in/out n-ch evss pullup enable data output disable input enable ev dd p-ch ev dd p-ch in/out n -ch ev ss pullup enable data output disable input enable ev dd p-ch ev dd p-ch in/out n -ch ev ss
chapter 2 pin functions user?s manual u19180ej1v0ud 71 figure 2-1. pin i/o circuit list (2/2) data output disable input enable ev dd p-ch x1, xt1 n -ch ev ss reset data output disable input enable ev dd p-ch n -ch ev ss reset p-ch n-ch x2, xt2 type 37 data output disable in/out n-ch input enable evss type 13-p
user?s manual u19180ej1v0ud 72 chapter 3 cpu architecture 3.1 memory space products in the 78k0/fx2 microcontrollers can each access a 64 kb memory space. figures 3-1 to 3-5 show the memory map. cautions 1. regardless of the inte rnal memory capacity, the initial val ues of the intern al memory size switching register (ims) and in ternal expansion ram size swit ching register (ixs) of all products in the 78k0/fx2 microcontrollers are fixed (ims = cfh, ixs = 0ch). therefore, set the value corresponding to each product as indicated below. 2. to set the memory size, set im s and then ixs. set the memory size so that th e internal rom and internal expansion ram areas do not overlap. table 3-1. set values of internal memo ry size switching register (ims) and internal expansion ram si ze switching register (ixs) 78k0/fc2 44-pin products 48-pin products 78k0/fe2 78k0/ff2 ims ixs rom capacity internal high- speed ram capacity internal expansion ram capacity pd78f0881a pd78f0884a ? ? c8h 0ah 32 kb 1 kb pd78f0882a pd78f0885a pd78f0887a ? cch 08h 48 kb 2 kb pd78f0883a pd78f0886a pd78f0888a pd78f0891a cfh 08h 60 kb 2 kb ? pd78f0894a pd78f0889a pd78f0892a cch note 3 04h 96 kb note 3 4 kb ? pd78f0895a pd78f0890a pd78f0893a cch note 3 00h 128 kb note 3 1 kb 6 kb note the pd78f0889a, 78f0890a, 78f0892a to 78f0895a hav e internal roms of 96 kb and 128 kb, respectively. however, the set value of ims of thes e devices is the same as those of the 48 kb product because memory banks are used. for how to set the memory banks, see 4.3 memory bank select register (bank) .
chapter 3 cpu architecture user?s manual u19180ej1v0ud 73 figure 3-1. memory map ( pd78f0881a, 78f0884a) ffffh ff00h feffh fee0h fedfh f800h f7ffh f3ffh 0000h internal high-speed ram 1024 8 bits general-purpose registers 32 8 bits flash memory 32768 8 bits program memory space data memory space f400h internal expansion ram 1024 8 bits ram space in which instruction can be fetched fa00h f9ffh fe20h fe1fh reserved fb00h faffh afcan area (256 8 bits) special function registers (sfr) 256 8 bits ff20h ff1fh short direct addressing 8000h 7fffh reserved note 1 fe10h fe0fh note 2 0190h 018fh 0083h 0082h 0800h 07ffh 1000h 0fffh vector table area 64 8 bits 0040h 003fh 0000h callt table area 64 8 bits 0085h 0084h program area 1915 8 bits option byte area note 3 5 8 bits callf entry area 2048 8 bits program area 7fffh program area 0080h 007fh 1085h 1084h 1080h 107fh option byte area note 3 5 8 bits 1fffh boot cluster 0 note 4 boot cluster 1 notes 1. during on-chip debugging, use of this area is dis abled since it is used as the user data backup area for communication. 2. during on-chip debugging, use of this area is disabled since it is used as the communication command area (269 bytes). 3. when boot swap is not used: set the option bytes to 0080h to 0084h. when boot swap is used: set the option bytes to 0080h to 0084h and 1080h to 1084h. 4. writing boot cluster 0 can be prohibited depending on the setting of security (see 23.8 security setting ). remark the flash memory is divided into blocks (one block = 1 kb). for the address values and block numbers, see table 3-2 correspondence between addr ess values and block numbers in flash memory . block 00h block 01h block 1fh 1 kb 7fffh 07ffh 0000h 0400h 03ffh ec00h ebffh
chapter 3 cpu architecture user?s manual u19180ej1v0ud 74 figure 3-2. memory map ( pd78f0882a, 78f0885a, 78f0887a) ffffh ff00h feffh fee0h fedfh f800h f7ffh f000h efffh 0000h internal high-speed ram 1024 8 bits general-purpose registers 32 8 bits flash memory 49152 8 bits program memory space data memory space internal expansion ram 2048 8 bits ram space in which instruction can be fetched fa00h f9ffh fe20h fe1fh reserved fb00h faffh afcan area (256 8 bits) special function registers (sfr) 256 8 bits ff20h ff1fh short direct addressing c000h bfffh reserved note 1 fe10h fe0fh note 2 0190h 018fh 0083h 0082h 0800h 07ffh 1000h 0fffh vector table area 64 8 bits 0040h 003fh 0000h callt table area 64 8 bits 0085h 0084h program area 1915 8 bits option byte area note 3 5 8 bits callf entry area 2048 8 bits program area bfffh program area 0080h 007fh 1085h 1084h 1080h 107fh option byte area note 3 5 8 bits 1fffh boot cluster 0 note 4 boot cluster 1 notes 1. during on-chip debugging, use of this area is dis abled since it is used as the user data backup area for communication. 2. during on-chip debugging, use of this area is disabled since it is used as the communication command area (269 byte). 3. when boot swap is not used: set the option bytes to 0080h to 0084h. when boot swap is used: set the option bytes to 0080h to 0084h and 1080h to 1084h. 4. writing boot cluster 0 can be prohibited depending on the setting of security (see 23.8 security setting ). remark the flash memory is divided into blocks (one block = 1 kb). for the address values and block numbers, see table 3-2 correspondence between addr ess values and block numbers in flash memory . block 00h block 01h block 2fh 1 kb bfffh 07ffh 0000h 0400h 03ffh ec00h ebffh
chapter 3 cpu architecture user?s manual u19180ej1v0ud 75 figure 3-3. memory map ( pd78f0883a, 78f0886a, 78f0888a, 78f0891a) ffffh ff00h feffh fee0h fedfh f800h f7ffh f000h efffh 0000h internal high-speed ram 1024 8 bits general-purpose registers 32 8 bits flash memory 61440 8 bits program memory space data memory space internal expansion ram 2048 8 bits ram space in which instruction can be fetched fa00h f9ffh fe20h fe1fh reserved fb00h faffh afcan area (256 8 bits) special function registers (sfr) 256 8 bits ff20h ff1fh short direct addressing note 1 fe10h fe0fh note 2 0190h 018fh 0083h 0082h 0800h 07ffh 1000h 0fffh 0040h 003fh 0000h 0085h 0084h program area efffh program area 0080h 007fh 1085h 1084h 1080h 107fh vector table area 64 8 bits callt table area 64 8 bits program area 1915 8 bits option byte area note 3 5 8 bits callf entry area 2048 8 bits option byte area note 3 5 8 bits 1fffh boot cluster 0 note 4 boot cluster 1 notes 1. during on-chip debugging, use of this area is dis abled since it is used as the user data backup area for communication. 2. during on-chip debugging, use of this area is disabled since it is used as the communication command area (269 bytes). 3. when boot swap is not used: set the option bytes to 0080h to 0084h. when boot swap is used: set the option bytes to 0080h to 0084h and 1080h to 1084h. 4. writing boot cluster 0 can be prohibited depending on the setting of security (see 23.8 security setting ). remark the flash memory is divided into blocks (one block = 1 kb). for the address values and block numbers, see table 3-2 correspondence between addr ess values and block numbers in flash memory . block 00h block 01h block 3bh 1 kb efffh 07ffh 0000h 0400h 03ffh ec00h ebffh
chapter 3 cpu architecture user?s manual u19180ej1v0ud 76 figure 3-4. memory map ( pd78f0889a, 78f0892a, 78f0894a) 16384 8 bits (bank 1) 16384 8 bits (bank 3) 16384 8 bits (bank 2) internal high-speed ram 1024 8 bits general-purpose registers 32 8 bits reserved reserved flash memory 32768 8 bits (common) flash memory 16384 8 bits (bank 0) program memory space data memory space internal expansion ram 4096 8 bits note 2 ram space in which instruction can be fetched note 1 special function registers (sfr) 256 8 bits short direct addressing afcan area 256 8 bits ffffh ff00h fee0h fedfh f800h f7ffh e800h e7ffh 8000h 7fffh 0000h 0083h 0082h 0190h 018fh c000h bfffh fe10h fe0fh fe20h fe1fh ff20h ff1fh fb00h faffh fa00h f9ffh feffh 0800h 07ffh 1000h 0fffh 0040h 003fh 0000h 0085h 0084h program area 7fffh program area 0080h 007fh 1085h 1084h 1080h 107fh vector table area 64 8 bits callt table area 64 8 bits program area 1915 8 bits option byte area note 3 5 8 bits callf entry area 2048 8 bits option byte area note 3 5 8 bits 1fffh boot cluster 0 note 4 boot cluster 1 notes 1. during on-chip debugging, use of this area is dis abled since it is used as t he user data backup area for communication. 2. during on-chip debugging, use of this area is di sabled since it is used as the communication command area (269 bytes). 3. when boot swap is not used: set the option bytes to 0080h to 0084h. when boot swap is used: set the option bytes to 0080h to 0084h and 1080h to 1084h. 4. writing boot cluster 0 can be prohibited depending on the setting of security (see 24.8 security setting ). remark the flash memory is divided into blocks (one block = 1 kb). for the address values and block numbers, see table 3-2 correspondence between addr ess values and block numbers in flash memory . block 00h block 01h block 1fh block 20h block 2fh 1 kb common area bank area (memory bank 0) block 30h block 3fh (memory bank 1) block 40h block 4fh (memory bank 2) block 50h block 5fh (memory bank 3) bfffh 8000h 7fffh 84ffh 83ffh bc00h bbffh 07ffh 0000h 0400h 03ffh 7c00h 7bffh
chapter 3 cpu architecture user?s manual u19180ej1v0ud 77 figure 3-5. memory map ( pd78f0890a, 78f0893a, 78f0895a) 16384 8 bits (bank 1) 16384 8 bits (bank 4) 16384 8 bits (bank 3) 16384 8 bits (bank 5) 16384 8 bits (bank 2) internal high-speed ram 1024 8 bits general-purpose registers 32 8 bits reserved reserved flash memory 32768 8 bits (common) flash memory 16384 8 bits (bank 0) program memory space internal expansion ram 6144 8 bits note 2 note 1 special function registers (sfr) 256 8 bits short direct addressing afcan area 256 8 bits ffffh ff00h feffh fee0h fedfh fb00h faffh f800h f7ffh e000h dfffh 8000h 7fffh 0000h 0083h 0082h 0190h 018fh c000h bfffh fa00h fe10h fe0fh fe20h fe1fh ff20h ff1fh data memory space f9ffh ram space in which instruction can be fetched 0800h 07ffh 1000h 0fffh 0040h 003fh 0000h 0085h 0084h program area 7fffh program area 0080h 007fh 1085h 1084h 1080h 107fh vector table area 64 8 bits callt table area 64 8 bits program area 1915 8 bits option byte area note 3 5 8 bits callf entry area 2048 8 bits option byte area note 3 5 8 bits 1fffh boot cluster 0 note 4 boot cluster 1 notes 1. during on-chip debugging, use of this area is dis abled since it is used as t he user data backup area for communication. 2. during on-chip debugging, use of this area is di sabled since it is used as the communication command area (269 bytes). 3. when boot swap is not used: set the option bytes to 0080h to 0084h. when boot swap is used: set the option bytes to 0080h to 0084h and 1080h to 1084h. 4. writing boot cluster 0 can be prohibited depending on the setting of security (see 24.8 security setting ). remark the flash memory is divided into blocks (one block = 1 kb). for the address values and block numbers, see table 3-2 correspondence between addr ess values and block numbers in flash memory . block 00h block 01h block 1fh block 20h block 2fh 1 kb common area bank area (memory bank 0) block 30h block 3fh (memory bank 1) block 40h block 4fh (memory bank 2) block 70h block 7fh (memory bank 5) . . . bfffh 8000h 7fffh 84ffh 83ffh bc00h bbffh 07ffh 0000h 0400h 03ffh 7c00h 7bffh
chapter 3 cpu architecture user?s manual u19180ej1v0ud 78 correspondence between the address values and block numbers in the flash memory are shown below. table 3-2. correspondence betw een address values and block nu mbers in flash memory (1/2) (1) pd78f088xa (x = 1 to 8), 78f0891a address value block number address value block number address value block number address value block number 0000h to 03ffh 00h 4000h to 43ffh 10h 8000h to 83ffh 20h c000h to c3ffh 30h 0400h to 07ffh 01h 4400h to 47ffh 11h 8400h to 87ffh 21h c400h to c7ffh 31h 0800h to 0bffh 02h 4800h to 4bffh 12h 8800h to 8bffh 22h c800h to cbffh 32h 0c00h to 0fffh 03h 4c00h to 4fffh 13h 8c00h to 8fffh 23h cc00h to cfffh 33h 1000h to 13ffh 04h 5000h to 53ffh 14h 9000h to 93ffh 24h d000h to d3ffh 34h 1400h to 17ffh 05h 5400h to 57ffh 15h 9400h to 97ffh 25h d400h to d7ffh 35h 1800h to 1bffh 06h 5800h to 5bffh 16h 9800h to 9bffh 26h d800h to dbffh 36h 1c00h to 1fffh 07h 5c00h to 5fffh 17h 9c00h to 9fffh 27h dc00h to dfffh 37h 2000h to 23ffh 08h 6000h to 63ffh 18h a000h to a3ffh 28h e000h to e3ffh 38h 2400h to 27ffh 09h 6400h to 67ffh 19h a400h to a7ffh 29h e400h to e7ffh 39h 2800h to 2bffh 0ah 6800h to 6bffh 1ah a800h to abffh 2ah e800h to ebffh 3ah 2c00h to 2fffh 0bh 6c00h to 6fffh 1bh ac00h to afffh 2bh ec00h to efffh 3bh 3000h to 33ffh 0ch 7000h to 73ffh 1ch b000h to b3ffh 2ch 3400h to 37ffh 0dh 7400h to 77ffh 1dh b400h to b7ffh 2dh 3800h to 3bffh 0eh 7800h to 7bffh 1eh b800h to bbffh 2eh 3c00h to 3fffh 0fh 7c00h to 7fffh 1fh bc00h to bfffh 2fh remark pd78f0881a, 78f0884a: block numbers 00h to 1fh pd78f0882a, 78f0885a, 78f0887a: block numbers 00h to 2fh pd78f0883a, 78f0886a, 78f0888a, 78f0891a: block numbers 00h to 3bh
chapter 3 cpu architecture user?s manual u19180ej1v0ud 79 table 3-2. correspondence betw een address values and block nu mbers in flash memory (2/2) (2) pd78f0889a, 78f089xa (x = 0, 2 to 5) address value block number address value memory bank block number address value memory bank block number address value memory bank block number 0000h to 03ffh 00h 8000h to 83ffh 20h 8000h to 83ffh 40h 8000h to 83ffh 60h 0400h to 07ffh 01h 8400h to 87ffh 21h 8400h to 87ffh 41h 8400h to 87ffh 61h 0800h to 0bffh 02h 8800h to 8bffh 22h 8800h to 8bffh 42h 8800h to 8bffh 62h 0c00h to 0fffh 03h 8c00h to 8fffh 23h 8c00h to 8fffh 43h 8c00h to 8fffh 63h 1000h to 13ffh 04h 9000h to 93ffh 24h 9000h to 93ffh 44h 9000h to 93ffh 64h 1400h to 17ffh 05h 9400h to 97ffh 25h 9400h to 97ffh 45h 9400h to 97ffh 65h 1800h to 1bffh 06h 9800h to 9bffh 26h 9800h to 9bffh 46h 9800h to 9bffh 66h 1c00h to 1fffh 07h 9c00h to 9fffh 27h 9c00h to 9fffh 47h 9c00h to 9fffh 67h 2000h to 23ffh 08h a000h to a3ffh 28h a000h to a3ffh 48h a000h to a3ffh 68h 2400h to 27ffh 09h a400h to a7ffh 29h a400h to a7ffh 49h a400h to a7ffh 69h 2800h to 2bffh 0ah a800h to abffh 2ah a800h to abffh 4ah a800h to abffh 6ah 2c00h to 2fffh 0bh ac00h to afffh 2bh ac00h to afffh 4bh ac00h to afffh 6bh 3000h to 33ffh 0ch b000h to b3ffh 2ch b000h to b3ffh 4ch b000h to b3ffh 6ch 3400h to 37ffh 0dh b400h to b7ffh 2dh b400h to b7ffh 4dh b400h to b7ffh 6dh 3800h to 3bffh 0eh b800h to bbffh 2eh b800h to bbffh 4eh b800h to bbffh 6eh 3c00h to 3fffh 0fh bc00h to bfffh 0 2fh bc00h to bfffh 2 4fh bc00h to bfffh 4 6fh 4000h to 43ffh 10h 8000h to 83ffh 30h 8000h to 83ffh 50h 8000h to 83ffh 70h 4400h to 47ffh 11h 8400h to 87ffh 31h 8400h to 87ffh 51h 8400h to 87ffh 71h 4800h to 4bffh 12h 8800h to 8bffh 32h 8800h to 8bffh 52h 8800h to 8bffh 72h 4c00h to 4fffh 13h 8c00h to 8fffh 33h 8c00h to 8fffh 53h 8c00h to 8fffh 73h 5000h to 53ffh 14h 9000h to 93ffh 34h 9000h to 93ffh 54h 9000h to 93ffh 74h 5400h to 57ffh 15h 9400h to 97ffh 35h 9400h to 97ffh 55h 9400h to 97ffh 75h 5800h to 5bffh 16h 9800h to 9bffh 36h 9800h to 9bffh 56h 9800h to 9bffh 76h 5c00h to 5fffh 17h 9c00h to 9fffh 37h 9c00h to 9fffh 57h 9c00h to 9fffh 77h 6000h to 63ffh 18h a000h to a3ffh 38h a000h to a3ffh 58h a000h to a3ffh 78h 6400h to 67ffh 19h a400h to a7ffh 39h a400h to a7ffh 59h a400h to a7ffh 79h 6800h to 6bffh 1ah a800h to abffh 3ah a800h to abffh 5ah a800h to abffh 7ah 6c00h to 6fffh 1bh ac00h to afffh 3bh ac00h to afffh 5bh ac00h to afffh 7bh 7000h to 73ffh 1ch b000h to b3ffh 3ch b000h to b3ffh 5ch b000h to b3ffh 7ch 7400h to 77ffh 1dh b400h to b7ffh 3dh b400h to b7ffh 5dh b400h to b7ffh 7dh 7800h to 7bffh 1eh b800h to bbffh 3eh b800h to bbffh 5eh b800h to bbffh 7eh 7c00h to 7fffh 1fh bc00h to bfffh 1 3fh bc00h to bfffh 3 5fh bc00h to bfffh 5 7fh remark pd78f0889a, 78f0892a, 78f0894a: block numbers 00h to 5fh pd78f0890a, 78f0893a, 78f0895a: block numbers 00h to 7fh
chapter 3 cpu architecture user?s manual u19180ej1v0ud 80 3.1.1 internal program memory space the internal program memory space stores the program and table data. normally, it is addressed with the program counter (pc). 78k0/fx2 microcontrollers incorporate intern al rom (flash memory), as shown below. table 3-3. intern al rom capacity 78k0/fc2 78k0/fe2 78k0/ff2 internal rom 44 pins 48 pins capacity pd78f0881a pd78f0884a ? ? 32768 8 bits (0000h to efffh) pd78f0882a pd78f0885a pd78f0887a ? 49152 8 bits (0000h to efffh) pd78f0883a pd78f0886a pd78f0888a pd78f0891a 61440 8 bits (0000h to efffh) ? pd78f0894a pd78f0889a pd78f0892a 98304 8 bits (0000h to 7fffh (common area: 32 kb) + 8000h to bfffh (bank area: 16 kb) 4) ? pd78f0895a pd78f0890a pd78f0893a 131072 8 bits (0000h to 7fffh (common area: 32 kb) + 8000h to bfffh (bank area: 16 kb) 6) the internal program memory space is divided into the following areas. (1) vector code area the 64-byte area 0000h to 003fh is reserved as a vect or code area. the program start addresses for branch upon reset signal input or generation of each interru pt request are stored in the vector code area. of the 16-bit address, the lower 8 bits are stored at even addresses and t he higher 8 bits are stored at odd addresses.
chapter 3 cpu architecture user?s manual u19180ej1v0ud 81 table 3-4. vector code vector code address interrupt source fc2 fe2 ff2 0000h reset input, poc, lvi, wdt 0004h intlvi 0006h intp0 0008h intp1 000ah intp2/inttm002 intp2 note 1 000ch intp3/inttm012 intp3 note 2 000eh intp4/inttm003 intp4 note 3 0010h intp5/inttm013 intp5 note 4 0012h intc0err 0014h intc0wup 0016h intc0rec 0018h intc0trx 001ah intsre60 001ch intsr60 001eh intst60 0020h intcsi10/intsre61 0022h intp6/intsr61 0024h intp7/intst61 0026h inttmh1 0028h inttmh0 002ah inttm50 002ch inttm000 002eh inttm010 0030h intad 0032h intwti/intdmu 0034h inttm51 0036h intwt 0038h intcsi11 ? 003ah inttm001 003ch inttm011 003eh brk notes 1. intp2 only. 2. intp3 only. 3. intp4 only. 4. intp5 only.
chapter 3 cpu architecture user?s manual u19180ej1v0ud 82 (2) callt instruction table area the 64-byte area 0040h to 007fh can st ore the subroutine entry address of a 1-byte call instruction (callt). (3) option byte area the option byte area is assigned to the 1-byte area of 0080h. refer to chapter 23 option byte for details. (4) callf instruction entry area the area 0800h to 0fffh can perform a direct subrout ine call with a 2-byte ca ll instruction (callf). (5) on-chip debug security id setting area a 10-byte area of 0085h to 008eh and 1085h to 108eh can be used as an on-chip debug security id setting area. set the on-chip debug security id of 10 byte s at 0085h to 008eh when the boot swap is not used and at 0085h to 008eh and 1085h to 108eh when the boot swap is used. for details, see chapter 25 on-chip debug function . 3.1.2 memory bank ( pd78f0889a, 78f0890a, 78f 0892a to 78f0895a only) the pd78f0889a, 78f0892a, 78f0894a hav e memory banks 0 to 3 and the pd78f0890a, 78f0893a, 78f0895a has memory banks 0 to 5 as illustrated below. the memory banks are selected by a memo ry bank select register (bank) (see 4.3 memory bank select register (bank) ). cautions 1. instructions cannot be fe tched between different memory banks. 2. branch and access cannot be directly executed between different memory banks. execute branch or access between differe nt memory banks via the common area. 3. allocate interrupt ser vicing in the common area. 4. an instruction that extends from 7fffh to 8000h can only be executed in memory bank 0. figure 3-6. internal rom (f lash memory) configuration (a) pd78f0889a, 78f0892a, 78f0894a 8000h 7fffh bfffh common area 32768 8 bits bank area 0 16384 8 bits 0000h bank area 3 16384 8 bits bank area 1 16384 8 bits bank area 2 16384 8 bits
chapter 3 cpu architecture user?s manual u19180ej1v0ud 83 (b) pd78f0890a, 78f0893a, 78f0895a 8000h 7fffh bfffh common area 32768 8 bits bank area 0 16384 8 bits 0000h bank area 1 16384 8 bits bank area 2 16384 8 bits bank area 3 16384 8 bits bank area 4 16384 8 bits bank area 5 16384 8 bits the following table shows the relations among bank num bers, cpu addresses, and real addresses of the flash memory. table 3-5. bank numbers, cpu address es, and real addresses of flash memory (a) pd78f0889a, 78f0892a, 78f0894a bank no. cpu address real address of flash memory ? 0000h to 7fffh (common area) 00000h to 07fffh 0 08000h to 0bfffh 1 0c000h to 0ffffh 2 10000h to 13fffh 3 8000h to bfffh 14000h to 17fffh 4 or more setting prohibited (b) pd78f0889a, 78f0893a, 78f0895a bank no. cpu address real address of flash memory ? 0000h to 7fffh (common area) 00000h to 07fffh 0 08000h to 0bfffh 1 0c000h to 0ffffh 2 10000h to 13fffh 3 14000h to 17fffh 4 18000h to 1bfffh 5 8000h to bfffh 1c000h to 1ffffh 6 or more setting prohibited
chapter 3 cpu architecture user?s manual u19180ej1v0ud 84 3.1.3 internal data memory space 78k0/fx2 microcontrollers inco rporate the following ram. (1) internal high-speed ram table 3-6. internal high-speed ram capacity 78k0/fc2 78k0/fe2 78k0/ff2 internal high-speed ram 44 pins 48 pins capacity pd78f0881a pd78f0884a ? ? 1024 8 bits (fb00h to feffh) pd78f0882a pd78f0885a pd78f0887a ? pd78f0883a pd78f0886a pd78f0888a pd78f0891a ? pd78f0894a pd78f0889a pd78f0892a ? pd78f0895a pd78f0890a pd78f0893a the 32-byte area fee0h to feffh is assigned to four ge neral-purpose register banks consisting of eight 8-bit registers per one bank. this area cannot be used as a program area in which instructions are written and executed. the internal high-speed ram can also be used as a stack memory. (2) internal expansion ram table 3-7. internal expansion ram capacity 78k0/fc2 78k0/fe2 78k0/ff2 internal high-speed ram 44 pins 48 pins capacity pd78f0881a pd78f0884a ? ? 1024 8 bits (f400h to f7ffh) pd78f0882a pd78f0885a pd78f0887a ? 2048 8 bits (f000h to f7ffh) pd78f0883a pd78f0886a pd78f0888a pd78f0891a ? pd78f0894a pd78f0889a pd78f0892a 4096 8 bits (e800h to f7ffh) ? pd78f0895a pd78f0890a pd78f0893a 6144 8 bits (e000h to f7ffh) the internal expansion ram can also be used as a normal data area similar to the internal high-speed ram, as well as a program area in which inst ructions can be written and executed. the internal expansion ram cannot be used as a stack memory. 3.1.4 special function register (sfr) area on-chip peripheral hardware special function registers (sfr s) are allocated in the area ff00h to ffffh (refer to table 3-8 special function register list in 3.2.3 special function registers (sfrs) ). caution do not access addresses to which sfrs are not assigned.
chapter 3 cpu architecture user?s manual u19180ej1v0ud 85 3.1.5 data memory addressing addressing refers to the method of specifying the address of the instruction to be executed next or the address of the register or memory relevant to the execution of instructions. several addressing modes are provided for addressing the me mory relevant to the exec ution of instructions for the 78k0/fx2 micro controllers, based on operability and other considerations. for areas containing data memory in particular, special addressing methods designed for the functions of special function registers (sfr) and general- purpose registers are available for use. figure 3-7 to 3-11 show correspondence between data memory and addressing. for details of each addressing mode, refer to 3.4 operand address addressing .
chapter 3 cpu architecture user?s manual u19180ej1v0ud 86 figure 3-7. correspondence between data memory and addressing ( pd78f0881a, 78f0884a) ffffh ff20h ff1fh 0000h ff00h feffh fee0h fedfh fe20h fe1fh 8000h 7fffh f800h f7ffh f400h f3ffh fb00h faffh special function registers (sfr) 256 8 bits short direct addressing sfr addressing internal high-speed ram 1024 8 bits general-purpose registers 32 8 bits flash memory 32768 8 bits register addressing direct addressing register indirect addressing based addressing based indexed addressing reserved internal expansion ram 1024 8 bits fa00h f9ffh reserved afcan area (256 8 bits) note 1 note 2 0083h 0082h 0190h 018fh fe10h fe0fh notes 1. during on-chip debugging, use of this area is dis abled since it is used as the user data backup area for communication. 2. during on-chip debugging, use of this area is disabled since it is used as the communication command area (269 bytes).
chapter 3 cpu architecture user?s manual u19180ej1v0ud 87 figure 3-8. correspondence between data memory and addressing ( pd78f0882a, 78f0885a, 78f0887a) ffffh ff20h ff1fh 0000h ff00h feffh fee0h fedfh fe20h fe1fh f800h f7ffh f000h efffh special function registers (sfr) 256 8 bits short direct addressing sfr addressing internal high-speed ram 1024 8 bits general-purpose registers 32 8 bits flash memory 49152 8 bits direct addressing register indirect addressing based addressing based indexed addressing internal expansion ram 2048 8 bits fa00h f9ffh reserved afcan area (256 8 bits) fb00h faffh register addressing c000h bfffh reserved note 1 note 2 0083h 0082h 0190h 018fh fe10h fe0fh notes 1. during on-chip debugging, use of this area is dis abled since it is used as the user data backup area for communication. 2. during on-chip debugging, use of this area is disabled since it is used as the communication command area (269 bytes).
chapter 3 cpu architecture user?s manual u19180ej1v0ud 88 figure 3-9. correspondence between data memory and addressing ( pd78f0883a, 78f0886a, 78f0888a, 78f0891a) ffffh ff20h ff1fh 0000h ff00h feffh fee0h fedfh fe20h fe1fh f800h f7ffh f000h efffh fe10h fe0fh special function registers (sfr) 256 8 bits short direct addressing sfr addressing internal high-speed ram 1024 8 bits general-purpose registers 32 8 bits flash memory 61440 8 bits direct addressing register indirect addressing based addressing based indexed addressing internal expansion ram 2048 8 bits fa00h f9ffh note 1 0083h 0082h note 2 reserved afcan area (256 8 bits) fb00h faffh register addressing 0190h 018fh notes 1. during on-chip debugging, use of this area is dis abled since it is used as the user data backup area for communication. 2. during on-chip debugging, use of this area is disabled since it is used as the communication command area (269 bytes).
chapter 3 cpu architecture user?s manual u19180ej1v0ud 89 figure 3-10. correspondence between data memory and addressing ( pd78f0889a, 78f0892a, 78f0894a) 16384 8 bits (bank 1) 16384 8 bits (bank 3) 16384 8 bits (bank 2) special function registers (sfr) 256 8 bits short direct addressing sfr addressing internal high-speed ram 1024 8 bits general-purpose registers 32 8 bits reserved flash memory 16384 8 bits (bank 0) register addressing direct addressing register indirect addressing based addressing based indexed addressing internal expansion ram 4096 8 bits note 1 note 2 afcan area (256 8 bits) ffffh ff00h feffh fee0h fedfh fb00h faffh f800h f7ffh e800h e7ffh 0000h 0083h 0082h 0190h 018fh fa00h f9ffh fe10h fe0fh fe20h fe1fh ff20h ff1fh reserved 8000h 7fffh c000h bfffh flash memory 32768 8 bits (common) notes 1. during on-chip debugging, use of this area is dis abled since it is used as the user data backup area for communication. 2. during on-chip debugging, use of this area is disabled since it is used as the communication command area (269 bytes).
chapter 3 cpu architecture user?s manual u19180ej1v0ud 90 figure 3-11. correspondence between data memory and addressing ( pd78f0890a, 78f0893a, 78f0895a) 16384 8 bits (bank 1) 16384 8 bits (bank 3) 16384 8 bits (bank 2) special function registers (sfr) 256 8 bits short direct addressing sfr addressing internal high-speed ram 1024 8 bits general-purpose registers 32 8 bits reserved flash memory 16384 8 bits (bank 0) register addressing direct addressing register indirect addressing based addressing based indexed addressing internal expansion ram 6144 8 bits note 1 note 2 afcan area (256 8 bits) ffffh ff00h feffh fee0h fedfh fb00h faffh f800h f7ffh e000h dfffh 0000h 0083h 0082h 0190h 018fh fa00h f9ffh fe10h fe0fh fe20h fe1fh ff20h ff1fh reserved 8000h 7fffh c000h bfffh flash memory 32768 8 bits (common) 16384 8 bits (bank 4) 16384 8 bits (bank 5) notes 1. during on-chip debugging, use of this area is dis abled since it is used as the user data backup area for communication. 2. during on-chip debugging, use of this area is disabled since it is used as the communication command area (269 bytes).
chapter 3 cpu architecture user?s manual u19180ej1v0ud 91 3.2 processor registers 78k0/fx2 microcontrollers incorporate the following processor registers. 3.2.1 control registers the control registers control the prog ram sequence, statuses and stack memory . the control registers consist of a program counter (pc), a program status word (psw) and a stack pointer (sp). (1) program counter (pc) the program counter is a 16-bit regist er that holds the address information of the next program to be executed. in normal operation, the pc is automatic ally incremented according to the num ber of bytes of the instruction to be fetched. when a branch instruction is executed, immediate data and register contents are set. reset signal generation sets the reset vector code values at addresses 0000h and 0001h to the program counter. figure 3-12. format of program counter 15 0 pc pc15 pc14 pc13 pc12 pc11 pc10 pc9 pc8 pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 (2) program status word (psw) the program status word is an 8-bit r egister consisting of various flags set/reset by instruction execution. program status word contents are st ored in the stack area upon vectored in terrupt request acknowledgement or push psw instruction execution and are restored upon execution of the retb, reti and pop psw instructions. reset signal generation sets psw to 02h. figure 3-13. format of program status word 7 0 psw ie z rbs1 ac rbs0 0 isp cy (a) interrupt enable flag (ie) this flag controls the interrupt reques t acknowledge operations of the cpu. when 0, the ie flag is set to the interrupt disabled (di) state, and all maskable interrupt requests are disabled. other interrupt requests are all disabled. when 1, the ie flag is set to the interrupt enabled (ei) state and interrupt request acknowledgement is controlled with an in-service priority flag (isp), an inte rrupt mask flag for various interrupt sources, and a priority specification flag. the ie flag is reset (0) upon di instruction executio n or interrupt acknowledgement and is set (1) upon ei instruction execution. (b) zero flag (z) when the operation result is zero, this flag is se t (1). it is reset (0 ) in all other cases.
chapter 3 cpu architecture user?s manual u19180ej1v0ud 92 (c) register bank select flags (rbs0 and rbs1) these are 2-bit flags to select one of the four register banks. in these flags, the 2-bit information that indicates t he register bank selected by sel rbn instruction execution is stored. (d) auxiliary carry flag (ac) if the operation result has a carry from bit 3 or a borrow at bit 3, this flag is se t (1). it is reset (0) in all other cases. (e) in-service priority flag (isp) this flag manages the priority of acknowledgeable maska ble vectored interrupts. when this flag is 0, low- level vectored interrupt requests s pecified by a priority s pecification flag register (pr0l, pr0h, pr1l, pr1h) (refer to 17.3 (3) priority specifi cation flag registers (pr0l, pr0h, pr1l, pr1h) ) can not be acknowledged. actual request acknowledgement is controlled by the interrupt enable flag (ie). (f) carry flag (cy) this flag stores overflow and underflow upon add/subtract instruction execution. it stores the shift-out value upon rotate instruction execution and functions as a bit accumulator during bit operation instruction execution. (3) stack pointer (sp) this is a 16-bit register to hold the start address of t he memory stack area. only the internal high-speed ram area can be set as the stack area. figure 3-14 format of stack pointer 15 0 sp sp15 sp14 sp13 sp12 sp11 sp10 sp9 sp8 sp7 sp6 sp5 sp4 sp3 sp2 sp1 sp0 the sp is decremented ahead of write (save) to the stack memory and is in cremented after read (restored) from the stack memory. each stack operation saves/restores dat a as shown in figures 3-15 and 3-16. caution since rest signal gene ration makes the sp contents undefine d, be sure to initialize the sp before using the stack.
chapter 3 cpu architecture user?s manual u19180ej1v0ud 93 figure 3-15. data to be saved to stack memory (a) push rp instruction (when sp = fee0h) register pair lower fee0h sp sp fee0h fedfh fedeh register pair higher fedeh (b) call, callf, callt instructions (when sp = fee0h) pc15 to pc8 fee0h sp sp fee0h fedfh fedeh pc7 to pc0 fedeh (c) interrupt, brk instruct ions (when sp = fee0h) pc15 to pc8 psw fedfh fee0h sp sp fee0h fedeh feddh pc7 to pc0 feddh
chapter 3 cpu architecture user?s manual u19180ej1v0ud 94 figure 3-16. data to be restored from stack memory (a) pop rp instruction (when sp = fedeh) register pair lower fee0h sp sp fee0h fedfh fedeh register pair higher fedeh (b) ret instruction (when sp = fedeh) pc15 to pc8 fee0h sp sp fee0h fedfh fedeh pc7 to pc0 fedeh (c) reti, retb instructions (when sp = feddh) pc15 to pc8 psw fedfh fee0h sp sp fee0h fedeh feddh pc7 to pc0 feddh
chapter 3 cpu architecture user?s manual u19180ej1v0ud 95 3.2.2 general-purpose registers general-purpose registers are mappe d at particular addresses (fee0h to feffh) of the data memory. the general-purpose registers consists of 4 banks, each bank consisting of eight 8-bit registers (x, a, c, b, e, d, l, and h). each register can be used as an 8-bit register, and two 8-bit registers can also be used in a pair as a 16-bit register (ax, bc, de, and hl). these registers can be described in terms of function names (x, a, c, b, e, d, l, h, ax, bc, de, and hl) and absolute names (r0 to r7 and rp0 to rp3). register banks to be used for instruction execution are se t by the cpu control instruction (sel rbn). because of the 4-register bank configuration, an efficient program can be created by switching between a register for normal processing and a register for interrupts for each bank. figure 3-17. configuration of general-purpose registers (a) absolute name bank0 bank1 bank2 bank3 feffh fef8h fee0h rp3 rp2 rp1 rp0 r7 15 0 7 0 r6 r5 r4 r3 r2 r1 r0 16-bit processing 8-bit processing fef0h fee8h (b) function name bank0 bank1 bank2 bank3 feffh fef8h fee0h hl de bc ax h 15 0 7 0 l d e b c a x 16-bit processing 8-bit processing fef0h fee8h
chapter 3 cpu architecture user?s manual u19180ej1v0ud 96 3.2.3 special function registers (sfrs) unlike a general-purpose register, each special f unction register has a special function. sfrs are allocated to the ff00h to ffffh area. special function registers can be manipulated like gener al-purpose registers, using operation, transfer and bit manipulation instructions. the manipulatable bit units, 1, 8, and 16, depend on the spec ial function register type. each manipulation bit unit can be specified as follows. ? 1-bit manipulation describe the symbol reserved by the assembler for the 1-bit manipulation instruction operand (sfr.bit). this manipulation can also be specified with an address. ? 8-bit manipulation describe the symbol reserved by the assembler fo r the 8-bit manipulation instruction operand (sfr). this manipulation can also be specified with an address. ? 16-bit manipulation describe the symbol reserved by the assembler fo r the 16-bit manipulation instruction operand (sfrp). when specifying an address, describe an even address. table 3-8 gives a list of the special f unction registers. the meanings of items in the table are as follows. ? symbol symbol indicating the address of a special function r egister. it is a reserved word in the ra78k0, and is defined by the header file ?sfrbit.h? in the cc78k0. when using the ra78k0, id78k0-ns, id78k0, or sm78k0, symbols can be written as an instruction operand. ? r/w indicates whether the corresponding special f unction register can be read or written. r/w: read/write enable r: read only w: write only ? manipulatable bit units indicates the manipulatable bit unit (1, 8, or 16). ? ? ? indicates a bit unit for which manipulation is not possible. ? after reset indicates each register status upon reset signal generation.
chapter 3 cpu architecture user?s manual u19180ej1v0ud 97 table 3-8. special function register list (1/6) manipulatable bit unit address special function regist er (sfr) name symbol r/w 1 bit 8 bits 16 bits after reset f c 2 f e 2 f f 2 ff00h port register 0 p0 r/w ? 00h ff01h port register 1 p1 r/w ? 00h ff02h 8-bit timer h compare register 00 cmp00 r/w ? ? 00h ff03h port register 3 p3 r/w ? 00h ff04h port register 4 p4 r/w ? 00h ff05h port register 5 p5 r/w ? 00h ? ff06h port register 6 p6 r/w ? 00h ff07h port register 7 p7 r/w ? 00h ff08h port register 8 p8 r/w ? 00h ff09h port register 9 p9 r/w ? 00h note ff0ah receive buffer register 60 rxb60 r ? ? ffh ff0bh transmit buffer register 60 txb60 r/w ? ? ffh ff0ch port register 12 p12 r/w ? 00h ff0dh port register 13 p13 r/w ? 00h ff0eh 8-bit timer h compare register 10 cmp10 r/w ? ? 00h ff0fh serial i/o shift register 10 sio10 r ? ? 00h ff10h ff11h 16-bit timer counter 00 tm00 r ? ? 0000h ff12h ff13h 16-bit timer capture/compare register 000 cr000 r/w ? ? 0000h ff14h ff15h 16-bit timer capture/compare register 010 cr010 r/w ? ? 0000h ff16h 8-bit timer counter 50 tm50 r ? ? 00h ff17h 8-bit timer compare register 50 cr50 r/w ? 00h ff18h 10- bit a/d conversion result register adcr r ? ? 0000h ff19h 8-bit a/d conversion result register adcrh r ? ? 00h ff1ah 8-bit timer h compare register 01 cmp01 r/w ? ? 00h ff1bh 8-bit timer h compare register 11 cmp11 r/w ? ? 00h ff1fh 8-bit timer counter 51 tm51 r ? ? 00h ff20h port mode register 0 pm0 r/w ? ffh ff21h port mode register 1 pm1 r/w ? ffh ff22h a/d port configuration register adpc r/w ? 00h ff23h port mode register 3 pm3 r/w ? ffh ff24h port mode register 4 pm4 r/w ? ffh ff25h port mode register 5 pm5 r/w ? ffh ? ff26h port mode register 6 pm6 r/w ? ffh ff27h port mode register 7 pm7 r/w ? ffh ff28h port mode register 8 pm8 r/w ? ffh ff29h port mode register 9 pm9 r/w ? ffh note note pd78f0884a, 78f0885a, 78f0886a, 78f0894a, and 78f0895a only.
chapter 3 cpu architecture user?s manual u19180ej1v0ud 98 table 3-8. special function register list (2/6) manipulatable bit unit address special function regist er (sfr) name symbol r/w 1 bit 8 bits 16 bits after reset f c 2 f e 2 f f 2 ff2ah a/d converter mode register adm r/w ? 00h ff2bh analog input channel specification register ads r/w ? 00h ff2ch port mode register 12 pm12 r/w ? ffh ff2dh port mode register 13 pm13 r/w ? feh ff2eh asynchronous serial interfac e selection register 61 asim61 r/w ? 01h ff2fh asynchronous serial inte rface reception error status register 61 asis61 r ? ? 00h ff30h pull-up resistor option register 0 pu0 r/w ? 00h ff31h pull-up resistor option register 1 pu1 r/w ? 00h ff33h pull-up resistor option register 3 pu3 r/w ? 00h ff34h pull-up resistor option register 4 pu4 r/w ? 00h ff35h pull-up resistor option register 5 pu5 r/w ? 00h ? ff36h pull-up resistor option register 6 pu6 r/w ? 00h ? ? ff37h pull-up resistor option register 7 pu7 r/w ? 00h ff38h asynchronous serial in terface transmission status register 61 asif61 r ? ? 00h ff39h clock selection register 61 cksr61 r/w ? ? 00h ff3ah asynchronous serial interface receive buffer register 61 rxb61 r/w ? ? ffh ff3bh asynchronous serial interface transmit buffer register 61 txb61 r/w ? ? ffh ff3ch pull-up resistor option register 12 pu12 r/w ? 00h ff3dh pull-up resistor option register 13 pu13 r/w ? 00h ff3eh baud rate generator control register 61 brgc61 r/w ? ? ffh ff3fh asynchronous serial interface control register 61 asicl61 r/w ? 16h ff40h clock output selection register cks r/w ? 00h ff41h 8-bit timer compare register 51 cr51 r/w ? 00h ff42h multiplier/divider control register 0 dmuc0 r/w ? 00h ff43h 8-bit timer mode control register 51 tmc51 r/w ? 00h ff44h sdr0l ff45h remainder data register 0 sdr0 sdr0h r/w ? 0000h ff47h serial i/o shift register 11 sio11 r ? ? 00h ? ff48h external interrupt risi ng edge enable register egp r/w ? 00h ff49h external interrupt fa lling edge enable register egn r/w ? 00h ff4ah multiplication/division data register a0l mda0l r/w ? 0000h ff4bh ff4ch multiplication/division data register a0h mda0h r/w ? 0000h ff4dh ff4eh transmit buffer register 11 sotb11 r/w ? ? 00h ?
chapter 3 cpu architecture user?s manual u19180ej1v0ud 99 table 3-8. special function register list (3/6) manipulatable bit unit address special function regist er (sfr) name symbol r/w 1 bit 8 bits 16 bits after reset f c 2 f e 2 f f 2 ff4fh input switch control register isc r/w ? 00h ff50h asynchronous serial interface operation mode register 60 asim60 r/w ? 01h ff51h prescaler mode register 03 prm03 r/w ? 00h ? ff52h capture/compare control register 03 crc03 r/w ? 00h ff53h asynchronous serial inte rface reception error status register 60 asis60 r ? ? 00h ff54h 16-bit timer mode control register 02 tmc02 r/w ? 00h ff55h asynchronous serial in terface transmission status register 60 asif60 r ? ? 00h ff56h clock selection register 60 cksr60 r/w ? ? 00h ff57h baud rate generator control register 60 brgc60 r/w ? ? ffh ff58h asynchronous serial interface control register 60 asicl60 r/w ? 16h ff59h prescaler mode register 02 prm02 r/w ? 00h ? ff5ah ff5bh 16-bit timer counter 02 tm02 r ? ? 0000h ? ff5ch capture/compare control register 02 crc02 r/w ? 00h ? ff60h ff61h module receive history list get pointer register c0rgpt r/w ? ? xx02h ff62h ff63h module transmission hist ory list get pointer register c0tgpt r/w ? ? xx02h ff64h ff65h can global macro clock selection c0gmctrl r/w ? ? 0000h ff66h ff67h can global macro automatic block transmission delay register c0gmabt r/w ? ? 0000h ff68h module last out pointer register c0lopt r ? ? undefined ff69h 8-bit timer h mode register 0 tmhmd0 r/w ? 00h ff6ah timer clock selection register 50 tcl50 r/w ? 00h ff6bh 8-bit timer mode control register 50 tmc50 r/w ? 00h ff6ch 16-bit capture/compare register 002 cr002 r/w ? ? 0000h ? ff6dh ff6eh can global macro clock se lection register c0gmcs r/w ? ? 0fh ff6fh can global macro automatic block transmission register c0gmabtd r/w ? ? 00h ff70h ff71h can module mask 1 register l c0mask1l r/w ? ? undefined ff72h ff73h can module mask 1 register h c0mask1h r/w ? ? undefined ff74h ff75h can module mask 2 register l c0mask2l r/w ? ? undefined
chapter 3 cpu architecture user?s manual u19180ej1v0ud 100 table 3-8. special function register list (4/6) manipulatable bit unit address special function regist er (sfr) name symbol r/w 1 bit 8 bits 16 bits after reset f c 2 f e 2 f f 2 ff76h ff77h can module mask 2 register h c0mask2h r/w ? ? undefined ff78h ff79h can module mask 3 register l c0mask3l r/w ? ? undefined ff7ah ff7bh can module mask 3 register h c0mask3h r/w ? ? undefined ff7ch ff7dh can module mask 4 register l c0mask4l r/w ? ? undefined ff7eh ff7fh can module mask 4 register h c0mask4h r/w ? ? undefined ff80h serial operation mode register 10 csim10 r/w ? 00h ff81h serial clock selection register 10 csic10 r/w ? 00h ff84h transmit buffer register 10 sotb10 r/w ? ? 00h ff88h serial operation mode register 11 csim11 r/w ? 00h ? ff89h serial clock selection register 11 csic11 r/w ? 00h ? ff8ah can module time stamp register c0ts r/w ? ? 0000h ff8bh ff8ch timer clock selection register 51 tcl51 r/w ? 00h ff8fh watch timer operation mode register wtm r/w ? 00h ff90h ff91h can module control register c0ctrl r/w ? ? 0000h ff92h can module last error code register c0lec r/w ? ? 00h ff93h can module information register c0info r ? ? 00h ff94h ff95h can module error counters c0erc r ? ? 0000h ff96h ff97h can module interrupt enable register c0ie r/w ? ? 0000h ff98h can module interrupt pending register c0ints r/w ? ? 0000h ff99h ff9bh watchdog timer enable register wdte r/w ? ? 1ah/9ah note1 ff9ch ff9dh can module bit rate register c0btr r/w ? ? 370fh ff9eh can module bit rate prescaler register c0brp r/w ? ? ffh ff9fh can module last in pointer register c0lipt r ? ? undefined ffa0h internal oscillator mode register rcm r/w ? 00h note2 ffa1h main clock mode register mcm r/w ? 00h ffa2h main osc control register moc r/w ? 80h notes 1. the reset value of wdte is determined by setting of option byte. 2. the value of this register is 00h immediately after a reset release but automatically changes to 80h after internal high-speed oscillator has been stabilized.
chapter 3 cpu architecture user?s manual u19180ej1v0ud 101 tables 3-8. special function register list (5/6) manipulatable bit unit address special function regist er (sfr) name symbol r/w 1 bit 8 bits 16 bits after reset f c 2 f e 2 f f 2 ffa3h oscillation stabilization time counter status register ostc r ? 00h ffa4h oscillation stabilization time select register osts r/w ? 05h ffa5h 16-bit timer output control register 02 toc02 r/w ? 00h ? ffa6h ffa7h 16-bit timer counter 03 tm03 r ? ? 0000h ? ffa8h ffa9h 16-bit timer capture/compare register 003 cr003 r/w ? ? 0000h ? ffaah ffabh 16-bit timer capture/compare register 013 cr013 r/w ? ? 0000h ? ffach reset control flag register resf r ? ? 00h note 1 ffadh 16-bit timer mode control register 03 tmc03 r/w ? 00h ? ffaeh mdb0l ffafh multiplier/divider data register b0 mdb0 mdb0h r/w ? 0000h ffb0h ffb1h 16-bit timer counter 01 tm01 r ? ? 0000h ffb2h 16-bit timer capture/compare register 001 cr001 r/w ? ? 0000h ffb3h ffb4h ffb5h 16-bit timer capture/compare register 011 cr011 r/w ? ? 0000h ffb6h 16-bit timer mode control register 01 tmc01 r/w ? 00h ffb7h prescaler mode register 01 prm01 r/w ? 00h ffb8h capture/compare control register 01 crc01 r/w ? 00h ffb9h 16-bit timer output control register 01 toc01 r/w ? 00h ffbah 16-bit timer mode control register 00 tmc00 r/w ? 00h ffbbh prescaler mode register 00 prm00 r/w ? 00h ffbch capture/compare control register 00 crc00 r/w ? 00h ffbdh 16-bit timer output control register 00 toc00 r/w ? 00h ffbeh low-voltage detection register lvim r/w ? 00h ffbfh low-voltage detection level selection register lvis r/w ? 00h ffc2h flash status register pfs r/w ? 00h ffc4h flash programming mode control register flpmc r/w ? 08h/0ch note 2 ffe0h interrupt request flag register 0l if0l r/w 00h ffe1h interrupt request flag register 0h if0 if0h r/w 00h ffe2h interrupt request flag register 1l if1l r/w 00h ffe3h interrupt request flag register 1h if1 if1h r/w 00h notes 1. this value varies depending on the reset source. 2. varies depending on the operation mode. ? user mode: 08h ? on-board mode: 0ch
chapter 3 cpu architecture user?s manual u19180ej1v0ud 102 tables 3-8. special function register list (6/6) manipulatable bit unit address special function regist er (sfr) name symbol r/w 1 bit 8 bits 16 bits after reset fc 2 fe 2 ff 2 ffe4h interrupt mask flag register 0l mk0l r/w ffh ffe5h interrupt mask flag register 0h mk0 mk0h r/w ffh ffe6h interrupt mask flag register 1l mk1l r/w ffh ffe7h interrupt mask flag register 1h mk1 mk1h r/w dfh ffe8h priority specificati on flag register 0l pr0l r/w ffh ffe9h priority specific ation flag register 0h pr0 pr0h r/w ffh ffeah priority specificati on flag register 1l pr1l r/w ffh ffebh priority specific ation flag register 1h pr1 pr1h r/w ffh ffech 16-bit timer capture/compare register 012 cr012 r/w ? ? 0000h ? ffedh ffeeh 8-bit timer h carrier control register 1 tmcyc1 r/w ? 00h ffefh clock operation mode select register oscctl r/w ? 00h fff0h internal memory size switching register note 1 ims r/w ? ? cfh fff3h memory bank select register bank r/w ? ? 00h note 2 note 3 fff4h internal expansion ram size switching register note 1 ixs r/w ? ? 0ch fff9h 16-bit timer output control register 03 toc03 r/w ? 00h ? fffah 8-bit timer h mode register 1 tmhmd1 r/w ? 00h fffbh processor clock control register pcc r/w ? 01h notes 1. regardless of the internal memory capacity, the init ial values of the internal memory size switching register (ims) and internal expansion ram size switchi ng register (ixs) of all products in the 78k0/fx2 microcontrollers are fixed (ims = cfh, ixs = 0ch). t herefore, set the value corresponding to each product as indicated below. flash memory products ims i xs rom capacity internal high- speed ram capacity internal expansion ram capacity pd78f0881a, 78f0884a c8h 0ah 32 kb 1 kb 1 kb pd78f0882a, 78f0885a, 78f0887a cch 08h 48 kb 2 kb pd78f0883a, 78f0886a, 78f0888a, 78f0891a cfh 08h 60 kb 2 kb pd78f0889a, 78f0892a, 78f0894a cch 04h 96 kb 4 kb pd78f0890a, 78f0893a, 78f0895a cch 00h 128 kb 6 kb 2. pd78f0894a, 78f0895a only 3. pd78f0889a, 78f0890a only
chapter 3 cpu architecture user?s manual u19180ej1v0ud 103 3.3 instruction address addressing an instruction address is determined by program counte r (pc) contents and is normally incremented (+1 for each byte) automatically according to the number of bytes of an instruction to be fetched each time another instruction is executed. when a branch instruction is executed, the branch destination informa tion is set to the pc and branched by the following addressing (for details of instructions, refer to 78k/0 series instructions user?s manual (u12326e) . 3.3.1 relative addressing [function] the value obtained by adding 8-bit immediate data (displac ement value: jdisp8) of an instruction code to the start address of the following instruction is transfe rred to the program counter (pc) and branched. the displacement value is treated as signed two?s complement data ( ? 128 to +127) and bit 7 becomes a sign bit. in other words, relative addressing consists of rela tive branching from the start address of the following instruction to the ? 128 to +127 range. this function is carried out when the br $addr16 instruct ion or a conditional branch instruction is executed. [illustration] 15 0 pc + 15 0 876 s 15 0 pc jdisp8 when s = 0, all bits of are 0. when s = 1, all bits of are 1. pc indicates the start address of the instruction after the br instruction. ...
chapter 3 cpu architecture user?s manual u19180ej1v0ud 104 3.3.2 immediate addressing [function] immediate data in the instruction word is tran sferred to the program counter (pc) and branched. this function is carried out when the call !addr16 or br !addr16 or callf !addr11 instruction is executed. call !addr16 and br !addr16 instructions can be branched to the entire me mory space. the callf !addr11 instruction is branc hed to the 0800h to 0fffh area. [illustration] in the case of call !addr16 and br !addr16 instructions 15 0 pc 87 70 call or br low addr. high addr. in the case of callf !addr11 instruction 15 0 pc 87 70 fa 10?8 11 10 00001 643 callf fa 7?0
chapter 3 cpu architecture user?s manual u19180ej1v0ud 105 3.3.3 table indirect addressing [function] table contents (branch destination addr ess) of the particular location to be addressed by bits 1 to 5 of the immediate data of an operation co de are transferred to the progr am counter (pc) and branched. this function is carried out when the ca llt [addr5] instruction is executed. this instruction references the address that is indi cated by addr5 and is stored in the memory table from 0040h to 007fh, and allows branching to the entire memory space. [illustration] 15 1 15 0 pc 70 low addr. high addr. memory (table) effective address+1 effective address 01 00000000 87 87 65 0 0 1 11 765 10 ta 4?0 operation code 15 1 addr5 01 00000000 65 0 0 ta 4?0 ... the value of the effective address is the same as that of addr5.
chapter 3 cpu architecture user?s manual u19180ej1v0ud 106 3.3.4 register addressing [function] register pair (ax) contents to be sp ecified with an instruction word are transferred to the program counter (pc) and branched. this function is carried out when t he br ax instruction is executed. [illustration] 70 rp 07 ax 15 0 pc 87
chapter 3 cpu architecture user?s manual u19180ej1v0ud 107 3.4 operand address addressing the following methods are available to specify the regi ster and memory (addressing) to undergo manipulation during instruction execution. 3.4.1 implied addressing [function] the register that functions as an accumulator (a and ax) among the general-purpose registers is automatically (implicitly) addressed. of the 78k0/ff2 instruction words, the followi ng instructions employ implied addressing. instruction register to be s pecified by implied addressing mulu a register for multiplicand and ax register for product storage divuw ax register for dividend and quotient storage adjba/adjbs a register for storage of numeric va lues that become decimal correction targets ror4/rol4 a register for storage of di git data that undergoes digit rotation [operand format] because implied addressing can be automatically employed with an instruction, no particular operand format is necessary. [description example] in the case of mulu x with an 8-bit 8-bit multiply instruction, the product of a register and x register is stored in ax. in this example, the a and ax registers are specified by implied addressing.
chapter 3 cpu architecture user?s manual u19180ej1v0ud 108 3.4.2 register addressing [function] the general-purpose register to be specified is access ed as an operand with the register bank select flags (rbs0 to rbs1) and the register specify co des (rn and rpn) of an operation code. register addressing is carried out when an instruction wit h the following operand format is executed. when an 8-bit register is specified, one of the eight registers is specified with 3 bits in the operation code. [operand format] identifier description r x, a, c, b, e, d, l, h rp ax, bc, de, hl ?r? and ?rp? can be described by absolute names (r0 to r7 and rp0 to rp3) as well as function names (x, a, c, b, e, d, l, h, ax, bc, de, and hl). [description example] mov a, c; when selecting c register as r operation code 0 1100010 register specify code incw de; when selecting de register pair as rp operation code 1 0000100 register specify code
chapter 3 cpu architecture user?s manual u19180ej1v0ud 109 3.4.3 direct addressing [function] the memory to be manipulated is directly addressed wit h immediate data in an instruction word becoming an operand address. [operand format] identifier description addr16 label or 16-bit immediate data [description example] mov a, !0fe00h; when setting !addr16 to fe00h operation code 10001110 op c ode 00000000 00h 11111110 feh [illustration] memory 0 7 addr16 (lower) addr16 (upper) op code
chapter 3 cpu architecture user?s manual u19180ej1v0ud 110 3.4.4 short direct addressing [function] the memory to be manipulated in the fixed space is di rectly addressed with 8-bit data in an instruction word. this addressing is applied to the 256-byte space fe 20h to ff1fh. internal ram and special function registers (sfrs) are mapped at fe20h to feffh and ff00h to ff1fh, respectively. the sfr area (ff00h to ff1f h) where short direct addressing is applie d is a part of the overall sfr area. ports that are frequently accessed in a program and compare and capture r egisters of the timer/event counter are mapped in this area, allowing sfrs to be mani pulated with a small number of bytes and clocks. when 8-bit immediate data is at 20h to ff h, bit 8 of an effective address is set to 0. when it is at 00h to 1fh, bit 8 is set to 1. refer to the [illustration] shown below. [operand format] identifier description saddr immediate data that indicate label or fe20h to ff1fh saddrp immediate data that indicate label or fe20h to ff1fh (even address only) [description example] mov 0fe30h, a; when transferring valu e of a register to saddr (fe30h) operation code 1 1110010 op c ode 0 0110000 30h (s addr-offset) [illustration] 15 0 short direct memory effective address 1 111111 87 0 7 op code saddr-offset when 8-bit immediate data is 20h to ffh, = 0 when 8-bit immediate data is 00h to 1fh, = 1
chapter 3 cpu architecture user?s manual u19180ej1v0ud 111 3.4.5 special function register (sfr) addressing [function] a memory-mapped special function regi ster (sfr) is addressed with 8-bit immediate data in an instruction word. this addressing is applie d to the 240-byte spaces ff00h to ffc fh and ffe0h to ffffh. however, the sfrs mapped at ff00h to ff1fh can be accessed with short direct addressing. [operand format] identifier description sfr special function register name sfrp 16-bit manipulatable special function register name (even address only) [description example] mov pm0, a; when selecting pm0 (ff20h) as sfr operation code 11110110 op c ode 00100000 20h (sfr-offset) [illustration] 15 0 sfr effective address 1 111111 87 0 7 op code sfr-offset 1
chapter 3 cpu architecture user?s manual u19180ej1v0ud 112 3.4.6 register indirect addressing [function] register pair contents specif ied by a register pair specify code in an instruction word and by a register bank select flag (rbs0 and rbs1) serve as an operand addre ss for addressing the memory. this addressing can be carried out for all the memory spaces. [operand format] identifier description ? [de], [hl] [description example] mov a, [de]; when selecting [de] as register pair operation code 10000101 [illustration] 16 0 8 d 7 e 0 7 7 0 a de the contents of the memory addressed are transferred. memory the memory address specified with the register pair de
chapter 3 cpu architecture user?s manual u19180ej1v0ud 113 3.4.7 based addressing [function] 8-bit immediate data is added as offset data to the contents of t he base register, that is, the hl register pair in the register bank specified by t he register bank select flag (rbs0 and rbs1), and the sum is used to address the memory. addition is performed by expanding the offs et data as a positive number to 16 bits. a carry from the 16th bit is ignored. this addressing can be carried out for all the memory spaces. [operand format] identifier description ? [hl + byte] [description example] mov a, [hl + 10h]; when setting byte to 10h operation code 10101110 00010000 [illustration] 16 0 8 h 7 l 0 7 7 0 a hl the contents of the memory addressed are transferred. memory + 10
chapter 3 cpu architecture user?s manual u19180ej1v0ud 114 3.4.8 based indexed addressing [function] the b or c register contents specifi ed in an instruction word are added to the contents of the base register, that is, the hl register pair in the register bank specified by the regist er bank select flag (rbs0 and rbs1), and the sum is used to address the memory. addition is performed by expanding the b or c register contents as a positive number to 16 bits. a carry from the 16th bit is ignored. this addressing can be carried out for all the memory spaces. [operand format] identifier description ? [hl + b], [hl + c] [description example] in the case of mov a, [hl + b]; (selecting b register) operation code 10101011 [illustration] 16 0 h 7 8 l 0 7 b + 0 7 7 0 a hl the contents of the memory addressed are transferred. memory
chapter 3 cpu architecture user?s manual u19180ej1v0ud 115 3.4.9 stack addressing [function] the stack area is indirectly addressed with the stack pointer (sp) contents. this addressing method is automatic ally employed when the push, pop, subroutine call and return instructions are executed or the register is sa ved/reset upon generation of an interrupt request. with stack addressing, only the internal high-speed ram area can be accessed. [description example] in the case of push de; (saving de register) operation code 10110101 [illustration] e fee0h sp sp fee0h fedfh fedeh d memory 0 7 fedeh
user?s manual u19180ej1v0ud 116 chapter 4 memory bank select function ( pd78f0889a, 78f0890a, 78f0892a to 78f0895a only) 4.1 memory bank the pd78f0889a, 78f0890a, 78f0892a to 78f0895a implem ent a rom capacity of 96 kb or 128 kb by selecting a memory bank from a memory space of 8000h to bfffh. the pd78f0889a, 78f0892a and 78f0894a has memory banks 0 to 3, and the pd78f0890a, 78f0893a and 78f0895a have memory banks 0 to 5, as shown below. the memory banks are selected by using a memory bank select register (bank). figure 4-1. internal rom (f lash memory) configuration (a) pd78f0889a, 78f0892a, 78f0894a 8000h 7fffh 0000h flash memory 32768 8 bits bfffh flash memory 16384 8 bits (memory bank 0) (memory bank 1) (memory bank 2) common area bank area (memory bank 3) (b) pd78f0890a, 78f0893a, 78f0895a 8000h 7fffh 0000h flash memory 32768 8 bits bfffh flash memory 16384 8 bits (memory bank 0) (memory bank 1) common area bank area (memory bank 3) (memory bank 4) (memory bank 5) (memory bank 2)
chapter 4 memory bank select function ( pd78f0889a, 78f0890a, 78f0892a to 78f0895a only) user?s manual u19180ej1v0ud 117 4.2 difference in representation of memory space with the 78k0/fx2 microcontrollers which support the memo ry bank, addresses can be viewed in the following two different ways. ? memory bank number + cpu address ? flash memory real address (hex format [bank]) figure 4-2. address view (a) memory bank number + cpu address (b) flash memory real a ddress (hex format [bank]) 0000h common (32 kb) memory bank 0 (16 kb) memory bank 1 memory bank 2 common area bank area memory bank 3 memory bank 4 memory bank 5 bfffh 8000h 7fffh memory bank 5 (16 kb) memory bank 4 (16 kb) memory bank 3 (16 kb) memory bank 2 (16 kb) memory bank 1 (16 kb) memory bank 0 (16 kb) common (32 kb) 1ffffh 1c000h 1bfffh 18000h 17fffh 14000h 13fffh 10000h 0ffffh 0c000h 0bfffh 08000h 07fffh 00000h ?memory bank number + cpu address? is represented with a vacancy in the address space, while the flash memory real address is shown with no vacancy in the address space. ?memory bank number + cpu address? is used for addressi ng in the user program. for on-board programming and self programming not using the self programming sample library note 1 , the flash memory real address is used. note that the hex file that is output by the assembler (ra78k0) by default uses the flash memory real address. for address representation of the other tool s such as the simulator and the debugger note 2 , see table 4-1 . notes 1. ?memory bank number + cpu address? can be used when performing self programming, using the self programming sample library, because the addresses are automatically translated. 2. sm+ for 78k0/fx2, id78k0-qb
chapter 4 memory bank select function ( pd78f0889a, 78f0890a, 78f0892a to 78f0895a only) user?s manual u19180ej1v0ud 118 table 4-1. memory bank address representation memory bank number cpu address flash memo ry real address address representation in simulator and debugger note 1 memory bank 0 08000h-0bfffh 08000h-0bfffh memory bank 1 0c000h-0ffffh 18000h-1bfffh memory bank 2 10000h-13fffh 28000h-2bfffh memory bank 3 14000h-17fffh 38000h-3bfffh memory bank 4 18000h-1bfffh 48000h-4bfffh memory bank 5 08000h-0bfffh note 2 1c000h-1ffffh 58000h-5bfffh notes 1. sm+ for 78k0/fx2, id78k0-qb 2. set the memory bank to be used by the memory bank select register (bank) (see figure 4-3 ). for details, see the ra78k0 ver. 3.80 assembler package operation user?s manual (u17199e) . 4.3 memory bank select register (bank) the memory bank select register (bank) is used to select a memory bank to be used. bank can be set by an 8-bit memory manipulation instruction. reset signal generation clears bank to 00h. figure 4-3. format of memory bank select register (bank) address: fff3h after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 bank 0 0 0 0 0 bank2 bank1 bank0 bank setting bank2 bank1 bank0 pd78f0889a, 78f0892a, 78f0894a pd78f0890a, 78f0893a, 78f0895a 0 0 0 common area (32 k) + memory bank 0 (16 k) 0 0 1 common area (32 k) + memory bank 1 (16 k) 0 1 0 common area (32 k) + memory bank 2 (16 k) 0 1 1 common area (32 k) + memory bank 3 (16 k) 1 0 0 common area (32 k) + memory bank 4 (16 k) 1 0 1 setting prohibited common area (32 k) + memory bank 5 (16 k) other than above setting prohibited caution be sure to change the value of the bank register in the common area (0000h to 7fffh). if the value of the bank register is changed in the bank area (8000h to bfffh), an inadvertent program loop occurs in the cpu. therefore, never change the value of the bank register in the bank area.
chapter 4 memory bank select function ( pd78f0889a, 78f0890a, 78f0892a to 78f0895a only) user?s manual u19180ej1v0ud 119 4.4 selecting memory bank the memory bank selected by the memory bank select r egister (bank) is reflect ed on the bank area and can be addressed. therefore, to access a memory bank different fr om the one currently selected, that memory bank must be selected by using the bank register. the value of the bank register must not be changed in the bank area (8000h to bfffh). therefore, to change the memory bank, branch an instruct ion to the common area (0000h to 7 fffh) and change the value of the bank register in that area. cautions 1. instructions cannot be fetched between different memory banks. 2. branching and accessing cannot be directly executed between different memory banks. execute branching or accessing between different memory banks via the common area. 3. allocate interrupt servicing in the common area. 4. an instruction that extends from 7fffh to 8000h can only be execute d in memory bank 0. 4.4.1 referencing values between memory banks values cannot be directly referenced from one memory bank to another. to access another memory bank from one memory bank, branch once to the common area (0000h to 7fffh), change the setting of the bank register there, and then reference a value. memory bank m common area bank area memory bank n referencing value common area bank area referencing value memory bank m memory bank n
chapter 4 memory bank select function ( pd78f0889a, 78f0890a, 78f0892a to 78f0895a only) user?s manual u19180ej1v0ud 120 ? software example (to store a value to be referenced in register a) ramd dseg saddr r_bnka: ds 2 ; secures ram for specifying an address at the reference destination. r_bnkn: ds 1 ; secures ram for specifying a me mory bank number at the reference destination. r_bnkrn: ds 1 ; secures ram for saving a memory bank number at the reference source. etrc cseg unit entry: mov r_bnkn,#banknum data1 ; stores the memo ry bank number at the reference destination. movw r_bnka,#data1 ; stores the address at the reference destination. call !bnkrd ; calls a subroutine for referencing between memory banks. : : bnkc cseg at 7000h bnkrd: ; subroutine for referencing between memory banks. push hl ; saves the contents of the hl register. mov a,r_bnkn ; acquires the memory bank number at the reference destination. xch a,bank ; swaps the memory bank number at the reference source for that at the reference ; destination mov r_bnkrn,a ; saves the memory bank number at the reference source. xchw ax,hl ; saves the contents of the x register. movw ax,r_bnka ; acquires the addr ess at the reference destination. xchw ax,hl ; specifies the addr ess at the reference destination. mov a,[hl] ; reads the target value. xch a,r_bnkrn ; acquires the memory bank number at the reference source. mov bank,a ; specifies the memory bank number at the reference source. mov a,r_bnkrn ; write the target value to the a register. pop hl ; restores the contents of the hl register. ret ; return data cseg bank3 data1: db 0aah end
chapter 4 memory bank select function ( pd78f0889a, 78f0890a, 78f0892a to 78f0895a only) user?s manual u19180ej1v0ud 121 4.4.2 branching instruction between memory banks instructions cannot branch directly from one memory bank to another. to branch an instruction from one memo ry bank to another, branch once to the common area (0000h to 7fffh), change the setting of the bank r egister there, and then execute the branch instruction again. memory bank m common area bank area memory bank n instruction branch common area bank area instruction branch memory bank m memory bank n
chapter 4 memory bank select function ( pd78f0889a, 78f0890a, 78f0892a to 78f0895a only) user?s manual u19180ej1v0ud 122 ? software example 1 (to branch from all areas) ? software example 2 (to branch from common area to any bank area) ramd dseg saddr r_bnka: ds 2 ; secures ram for specifying a memory bank at the branch destination. r_bnkn: ds 1 ; secures ram for specifying a memory bank number at the branch destination. rsaveax: ds 2 ; secures ram for saving the ax register. etrc cseg unit entry: mov r_bnkn,#banknum test ; stores the memory bank number at the branch destination in ram. movw r_bnka,#test ; stores the address at the branch destination in ram. br !bnkbr ; branches to in ter-memory bank branch processing. : : bnkc cseg at 7000h ; bnkbr: movw rsaveax,ax ; saves the ax register. mov a,r_bnkn ; acquires the memory bank number at the branch destination. mov bank,a ; specifies the memory bank number at the branch destination. movw ax,r_bnka ; specifies the address at the branch destination. push ax ; sets the address at the branch destination to stack. movw ax,rsaveax ; restores the ax register. ret ; branch bn3 cseg bank3 test: mov ??? : : end etrc cseg at 2000h entry: mov r_bnkn,#banknum test ; stores the memory bank number at the branch destination in ram. br !test ; stores the address at the branch destination in ram. bn3 cseg bank3 test: mov ??? : : end
chapter 4 memory bank select function ( pd78f0889a, 78f0890a, 78f0892a to 78f0895a only) user?s manual u19180ej1v0ud 123 4.4.3 subroutine call between memory banks subroutines cannot be directly called between memory banks. to call a subroutine between memory banks, branch once to the common area (0000h to 7fffh), specify the memory bank at the calling destination by using the bank register there, execute the call instruction, and branch to the call destination by that instruction. at this time, save the current value of the bank register to ram. restor e the value of the bank register before executing the re t instruction. memory bank m common area bank area memory bank n br instruction common area bank area call instruction memory bank m memory bank n call inst- ruction call instruction change bank and save memory bank number at calling source. ret instruction ret instruction
chapter 4 memory bank select function ( pd78f0889a, 78f0890a, 78f0892a to 78f0895a only) user?s manual u19180ej1v0ud 124 ? software example remark in the software example above, mult iplexed processing is not supported. ramd dseg saddr r_bnka: ds 2 ; secures ram for specifying an address at the calling destination. r_bnkn: ds 1 ; secures ram for specifying a memory bank number at the calling destination. r_bnkrn: ds 1 ; secures ram for saving a memory bank number at the calling source. rsaveax: ds 2 ; secures ram for saving the ax register. etrc cseg unit entry: mov r_bnkn,#banknum test ; store the memory bank number at the calling destination in ram. movw r_bnka,#test ; stores the address at the calling destination in ram. call !bnkcal ; branches to an inter-memory bank calling processing routine. : : bnkc cseg at 7000h bnkcal: ; inter-memory bank calling processing routine movw rsaveax,ax ; saves the ax register. mov a,r_bnkn ; acquires the memory bank number at the calling destination. xch a,bank ; changes the b ank and acquires the memory bank number at the calling source. mov r_bnkrn,a ; saves the memory bank number at the calling source to ram. call !bnkcals ; calls a subroutine to branch to the calling destination. movw rsaveax,ax ; saves the ax register. xch a,r_bnkrn ; acquires the memory bank number at the calling source. mov bank,a ; specifies the memory bank number at the calling source. movw rsaveax,ax ; restores the ax register. ret ; returns to the calling source. bnkcals: movw ax,r_bnka ; specifies the address at the calling destination. push ax ; sets the address at the calling destination to stack. movw ax,rsaveax ; restores source ax register. ret ax ; branches to the calling destination. bn3 cseg bank3 test: ; mov ??? : : ret end
chapter 4 memory bank select function ( pd78f0889a, 78f0890a, 78f0892a to 78f0895a only) user?s manual u19180ej1v0ud 125 4.4.4 instruction branch to bank area by interrupt when an interrupt occurs, instructions can branch to the me mory bank specified by the bank register by using the vector table, but it is difficult to identif y the bank register when the interrupt occurs. therefore, specify the branc h destination address specified by the vect or table in the common area (0000h to 7fffh), specify the memory bank at t he branch destination by using the bank register in the common area, and execute the call instruction. at th is time, save the bank register value before the change to ram, and restore the value of the bank register before executing the reti instruction. remark allocate interrupt servicing that requires a quick response in the common area. memory bank m common area bank area memory bank n instruction branch save the original memory bank number. specify the address and memory bank at the destination, and execute the call instruction. vector table ? software example (when using interrupt request of 16-bit timer/event counter 00) vctbl cseg at 0020h dw bnkitm000 ; specifies an address at the timer interrupt destination. ramd dseg saddr r_bnkrn: ds 1 ; secures ram for saving the memory bank number before the interrupt occurs. bnkc cseg at 7000h bnkitm000: ; inter-memory ban k interrupt servicing routine push ax ; saves the contents of the ax register. mov a,bank mov r_bnkrn,a ; saves the memory bank number before the interrupt to ram. mov bank,#banknum test ; specifies the me mory bank number of the interrupt routine. call !test ; calls the interrupt routine. mov a,r_bnkrn ; restores the memo ry bank number before the interrupt. mov bank,a pop ax ; restores the contents of the ax register. reti bn3 cseg bank3 test: ; interrupt servicing routine mov ??? : : ret end
chapter 4 memory bank select function ( pd78f0889a, 78f0890a, 78f0892a to 78f0895a only) user?s manual u19180ej1v0ud 126 remark note the following points to use the memory bank select function efficiently. ? allocate a routine that is used often in the common area. ? if a value that is planned to be referenced is placed in ram, it can be referenced from all of the areas. ? if the reference destination and the branch destina tion of the routine placed in a memory bank are placed in the same memory bank, then the code size and processing are more efficient. ? allocate interrupt servicing that requires a quick response in the common area.
user?s manual u19180ej1v0ud 127 chapter 5 port functions 5.1 port functions pin i/o buffer power supplies depend on the product. the relationship between t hese power supplies and the pins is shown below. table 5-1. pin i/o buffer power supplies (av ref , ev dd /v dd ) ? 78k0/fc2: 44-pin plastic lqfp (10x10), 48-pin plastic lqfp (fine pitch) (7x7) power supply corresponding pins av ref p80 to p87, p90 note ev dd /v dd ? port pins other than p80 to p87, p90 note ? non-port pins note p90 is pd78f0884a, 78f0885a, 78f0886a, 78f0894a, and 78f0895a only. table 5-2. pin i/o buffer power supplies (av ref , ev dd , v dd ) ? 78k0/fe2: 64-pin plastic lqfp (fine pitc h) (10x10), 64-pin plastic lqfp (12x12) ? 78k0/ff2: 80-pin plastic lqfp (14x14), 80- pin plastic lqfp (fine pitch) (12x12) power supply corresponding pins av ref p80 to p87, p90 to p97 note ev dd port pins other than p80 to p87, p90 to p97 note and p121 to p124 v dd ? p121 to p124 ? non-port pins note p94 to p97 is 78k0/ff2 only. 78k0/fx2 microcontrollers are provided with digital i/o por ts, which enable variety of control operations. the functions of each port are shown in table 5-3. in addition to the func tion as digital i/o ports, these ports have several alternate f unctions. for details of the alternate functions, refer to chapter 2 pin functions .
chapter 5 port functions user?s manual u19180ej1v0ud 128 table 5-3. port functions (1/2) f c 2 f e 2 f f 2 pin name i/o function after reset alternate function p00 ti000 p01 ti010/to00 ? p05 ssi11/ti001 note 1 p06 i/o port 0. 4-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input ti011/to01 p10 sck10/txd61 p11 si10/rxd61 p12 so10 p13 txd60 p14 rxd60 p15 toh0 p16 toh1/intp5 p17 i/o port 1. 8-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input ti50/to50 p30 intp1 p31 intp2/ti002 note 2 p32 intp3/ti012/to02 note 3 p33 i/o port 3. 4-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input intp4/ti51/to51 p40, p41 ? p42, p43 ? ? p44 to p47 i/o port 4. 8-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input ? ? p50 to p53 ? ? p54 to p57 i/o port 5. 8-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input ? p60 to p62 n-ch open drain i/o port. note 1 p63 ? ? p64 to p67 i/o port 6. 8-bit i/o port input/output can be specified in 1-bit units. use of an on-chip pull-up resister can be specified by a software setting input ? p70 ctxd p71 crxd p72 pcl/intp6 p73 buz/intp7 ? p74 so11 ? p75 si11 ? p76 i/o port 7. 7-bit i/o port. input/output can be specified in 1-bit units. use of an on-chip pull-up resistor can be specified by a software setting. input sck11 notes 1. p06, p63 are pd78f0884a, 78f0885a, 78f0896a, 78f 0894a and 78f0895a only. 2. 78k0/fc2 is intp2 only 3. 78k0/fc2 is intp3 only
chapter 5 port functions user?s manual u19180ej1v0ud 129 table 5-3. port functions (2/2) f c 2 f e 2 f f 2 pin name i/o function after reset alternate function p80 to p87 i/o port 8. 8-bit i/o port. input/output can be specified in 1-bit units. input ani0 to ani7 note p90 ? p91 to p93 ? ? p94 to p97 i/o port 9. 8-bit i/o port. input/output can be specified in 1-bit units. input ani8 to ani15 p120 intp0/exlvi p121 x1 p122 x2/exclk p123 xt1 p124 i/o port 12. 5-bit i/o port. only for p120, use of an on-chip pull-up resistor can be specified by a software setting. input xt2/exclks p130 output output ? note p131 ti003 ? p132 i/o port 13. p130 is 1-bit output-only port. p131 and p132 are 2-bit i/o port. p131 and p132 use of an on-chip pull-up resistor can be specified by a software setting. input ti013/to03 note p90, p131 are pd78f0884a, 78f0885a, 78f0886a, 78f0894a, and 78f0895a only.
chapter 5 port functions user?s manual u19180ej1v0ud 130 5.2 port configuration ports include the following hardware. table 5-4. port configuration item configuration control registers ? 44-pin products of 78k0/fc2 port mode register (pm0, pm1, pm3, pm4, pm6 to pm8, pm12) port register (p0, p1, p3, p4, p6 to p8, p12, p13) pull-up resistor option register (pu0, pu1, pu3, pu4, pu7, pu12) a/d port configuration register (adpc) ? 48-pin products of 78k0/fc2 port mode register (pm0, pm1, pm3, pm6 to pm9, pm12, pm13) port register (p0, p1, p3, p4 to p9, p12, p13) pull-up resistor option register (pu0, pu1, pu3, pu4, pu7, pu12, pu13) a/d port configuration register (adpc) ? 78k0/fe2 port mode register (pm0, pm1, pm3 to pm9, pm12, pm13) port register (p0, p1, p3 to p9, p12, p13) pull-up resistor option register (pu0, pu1, pu3 to pu5, pu7, pu12, pu13) a/d port configuration register (adpc) ? 78k0/ff2 port mode register (pm0, pm1, pm3 to pm9, pm12, pm13) port register (p0, p1, p3 to p9, p12, p13) pull-up resistor option register (pu0, pu1, pu3 to pu7, pu12, pu13) a/d port configuration register (adpc) port ? 44-pin products of 78k0/fc2: total: 37 (cmos i/o: 33, cmos output: 1, n-ch open drain i/o: 3) ? 48-pin products of 78k0/fc2: total: 41 (cmos i/o: 36, cmos output: 1, n-ch open drain i/o: 4) ? 78k0/fe2: total: 55 (cmos i/o: 50, cmos output: 1, n-ch open drain i/o: 4) ? 78k0/ff2: total: 71 (cmos i/o: 66, cmos output: 1, n-ch open drain i/o: 4) pull-up resistor ? 44-pin products of 78k0/fc2: total: 21 ? 48-pin products of 78k0/fc2: total: 23 ? 78k0/fe2: total: 34 ? 78k0/ff2: total: 46
chapter 5 port functions user?s manual u19180ej1v0ud 131 5.2.1 port 0 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 3 y = 4 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p00/ti000 p01/ti010/to00 p05/ti001/ssi11 ? ? p06/ti011/to01 ? remark : mounted, ? : not mounted port 0 is a 4-bit i/o port with an output latch. port 0 can be set to the input mode or output mode in 1-bit units using port mode register 0 (pm0). w hen the p00, p01, p05 and p 06 pins are used as an input port, use of an on-chip pull-up resistor can be specified in 1-bit units by pull-up resistor option register 0 (pu0). this port can also be used for timer i/o, serial interface chip select input. reset signal generation sets port 0 to input mode. figures 5-1 and 5-2 show block diagrams of port 0. caution to use p05/ssi11/ti001 as general-purpose por ts, set serial operation mode register 11 (csim11) to the default status (00h).
chapter 5 port functions user?s manual u19180ej1v0ud 132 figure 5-1. block diagram of p00 and p05 p00/ti000, p05/ssi11/ti001 wr pu rd wr port wr pm pu00, pu05 alternate function output latch (p00, p05) pm00, pm05 ev dd p-ch selector internal bus pu0 pm0 p0 p0: port register 0 pu0: pull-up resistor option register 0 pm0: port mode register 0 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 133 figure 5-2. block diagram of p01 and p06 p01/ti010/to00, p06/ti011/to01 wr pu rd wr port wr pm pu01, pu06 alternate function output latch (p01, p06) pm01, pm06 alternate function ev dd p-ch selector internal bus pu0 pm0 p0 p0: port register 0 pu0: pull-up resistor option register 0 pm0: port mode register 0 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 134 5.2.2 port 1 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p10/sck10/txd61 p11/si10/rxd61 p12/so10 p13/txd60 p14/rxd60 p15/toh0 p16/toh1/intp5 p17/ti50/to50 remark : mounted port 1 is an 8-bit i/o port with an output latch. port 1 can be set to the input mode or output mode in 1-bit units using port mode register 1 (pm1). when the p10 to p17 pi ns are used as an input port, use of an on-chip pull-up resistor can be specified in 1-bit units by pull-up resistor option register 1 (pu1). this port can also be used for external interrupt requ est input, serial interfac e data i/o, clock i/o, and timer i/o. reset signal generation sets port 1 to input mode. figures 5-3 to 5-7 show block diagrams of port 1. cautions 1. to use p10/sck10/txd61 and p12/so10 as general-purpose ports, se t serial operation mode register 10 (csim10) and serial clock selecti on register 10 (csic10) to the default status (00h). 2. to use p10/sck10/txd61 and p13/txd60 as general-purpose ports, clear bit 0 (txdlv60, txdlv61) of asynchronous serial interface control register 60, 61 (asicl60, asicl61) to 0 (normal output of txd6n).
chapter 5 port functions user?s manual u19180ej1v0ud 135 figure 5-3. block diagram of p10 p10/sck10/txd61 wr pu rd wr port wr pm pu10 alternate function output latch (p10) pm10 alternate function ev dd p-ch selector internal bus pu1 pm1 p1 p1: port register 1 pu1: pull-up resistor option register 1 pm1: port mode register 1 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 136 figure 5-4. block diagram of p11 and p14 p11/si10/rxd61, p14/rxd60 wr pu rd wr port wr pm pu11, pu14 alternate function output latch (p11, p14) pm11, pm14 ev dd p-ch selector internal bus pu1 pm1 p1 p1: port register 1 pu1: pull-up resistor option register 1 pm1: port mode register 1 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 137 figure 5-5. block diagram of p12 and p15 p12/so10, p15/toh0 wr pu rd wr port wr pm pu12, pu15 output latch (p12, p15) pm12, pm15 alternate function ev dd p-ch selector internal bus pu1 pm1 p1 p1: port register 1 pu1: pull-up resistor option register 1 pm1: port mode register 1 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 138 figure 5-6. block diagram of p13 p13/txd60 wr pu rd wr port wr pm pu13 pm13 ev dd p-ch pu1 pm1 p1 selector internal bus alternate function output latch (p13) p1: port register 1 pu1: pull-up resistor option register 1 pm1: port mode register 1 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 139 figure 5-7. block diagram of p16 and p17 p16/toh1/intp5, p17/ti50/to50 wr pu rd wr port wr pm pu16, pu17 pm16, pm17 ev dd p-ch pu1 pm1 p1 output latch (p16, p17) internal bus selector alternate function alternate function p1: port register 1 pu1: pull-up resistor option register 1 pm1: port mode register 1 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 140 5.2.3 port 3 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p30/intp1 p31/intp2/ti002 p31/intp2 note 1 p32/intp3/ti012/ to02 p32/intp3 note 2 p33/intp4/ti51/ to51 notes 1. ti002 pin is not mounted. port functions other t han ti002 as well as shared functions are provided. 2. ti012, to02 pins are not mo unted. port functions other than ti 012 and to02 as well as shared functions are provided. remark : mounted port 3 is a 4-bit i/o port with an output latch. port 3 can be set to the input mode or output mode in 1-bit units using port mode register 3 (pm3). when used as an input por t, use of an on-chip pull-up resistor can be specified in 1-bit units by pull-up resist or option register 3 (pu3). this port can also be used for external interrupt request input and timer i/o. reset signal generation sets port 3 to input mode. figures 5-8 and 5-9 show block diagrams of port 3. cautions 1. be sure to pull th e p31 pin down before a reset release, to prevent malfunction. 2. connect p31/ti002/intp2 as follows when writ ing the flash memory wit h a flash programmer. - p31/ti002/intp2: connect to ev ss via a resistor (10 k : recommended). the above connection is no t necessary when writing the fl ash memory by means of self programming. remark p31/intp2/ti002 and p32/intp3/ti012/to02 can be used as on-chip debug mode setting pins when the on-chip debug function is used. for how to connect an on-chip debug emulator (qb-78k0mini or qb-mini2), see chapter 25 on-chip debug function .
chapter 5 port functions user?s manual u19180ej1v0ud 141 figure 5-8. block diagram of p30 and p31 p30/intp1, p31/intp2/ti002 note wr pu rd wr port wr pm pu30, pu31 alternate function output latch (p30, p31) pm30, pm31 ev dd p-ch selector internal bus pu3 pm3 p3 note ti002 is 78k0/fe2, 78k0/ff2 only. p3: port register 3 pu3: pull-up resistor option register 3 pm3: port mode register 3 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 142 figure 5-9. block diagram of p32 (1/2) (1) 78k0/fc2 p32/intp3 wr pu rd wr port wr pm pu32 alternate function output latch (p32) pm32 ev dd p-ch selector internal bus pu3 pm3 p3 p3: port register 3 pu3: pull-up resistor option register 3 pm3: port mode register 3 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 143 figure 5-9. block diagram of p32 and p33 (2/2) (2) 78k0/fe2, 78k0/ff2 p32/intp3/ti012/to02 wr pu rd wr port wr pm pu32 alternate function output latch (p32) pm32 alternate function ev dd p-ch selector internal bus pu3 pm3 p3 p3: port register 3 pu3: pull-up resistor option register 3 pm3: port mode register 3 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 144 figure 5-10. blo ck diagram of p33 p33/intp4/ti51/to51 wr pu rd wr port wr pm pu33 alternate function output latch (p33) pm33 alternate function ev dd p-ch selector internal bus pu3 pm3 p3 p3: port register 3 pu3: pull-up resistor option register 3 pm3: port mode register 3 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 145 5.2.4 port 4 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p40 p41 p42 ? p43 ? p44 ? ? p45 ? ? p46 ? ? p47 ? ? remark : mounted, ? : not mounted port 4 is a 8-bit i/o port with an output latch. port 4 can be set to the input mode or output mode in 1-bit units using port mode register 4 (pm4). use of an on-chip pull-up resistor can be specified in 1-bit units with pull-up resistor option register 4 (pu4). reset signal generation sets port 4 to input mode. figure 5-11 shows a block diagram of port 4. figure 5-11. block di agram of p40 to p47 rd p-ch wr pu wr port wr pm ev dd p40 to p47 pu40 to pu47 output latch (p40 to p47) pm40 to pm47 selector internal bus pu4 pm4 p4 p4: port register 4 pu4: pull-up resistor option register 4 pm4: port mode register 4 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 146 5.2.5 port 5 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p50 ? p51 ? p52 ? p53 ? p54 ? ? p55 ? ? p56 ? ? p57 ? ? remark : mounted, ? : not mounted port 5 is 8-bit i/o port with an output la tch. port 5 can be set to the input mode or output mode in 1-bit units using port mode register 5 (pm5). use of an on-chip pull-up resist or can be specified in 1-bit units using pull-up resistor option register 5 (pu5). reset signal generation sets port 5 to input mode. figure 5-12 shows a block diagram of port 5. figure 5-12. block di agram of p50 to p57 rd p-ch wr pu wr port wr pm ev dd p50 to p57 pu50 to pu57 output latch (p50 to p57) pm50 to pm57 selector internal bus pu5 pm5 p5 p5: port register 5 pu5: pull-up resistor option register 5 pm5: port mode register 5 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 147 5.2.6 port 6 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 3 y = 4 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p60 p61 p62 p63 ? p64 ? ? ? p65 ? ? ? p66 ? ? ? p67 ? ? ? remark : mounted, ? : not mounted port 6 is a 8-bit i/o port with an output latch. port 6 can be set to the input mode or output mode in 1-bit units using port mode register 6 (pm6). p64 top67 use of an on-c hip pull-up resistor can be specified in 1-bit units using pull-up resistor option register 6 (pu6). p60 to p 63 are not including pull-up resistor option register. the p60 to p63 pins are n-ch open-drain pins (6 v tolerance). reset signal generation sets port 6 to input mode. figures 5-13 and 5-14 show block diagrams of port 6.
chapter 5 port functions user?s manual u19180ej1v0ud 148 figure 5-13. block diag ram of p60 to p63 rd p60 to p63 wr port wr pm output latch (p60 to p63) pm60 to pm63 selector internal bus pm6 p6 p6: port register 6 pm6: port mode register 6 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 149 figure 5-14. block di agram of p64 to p67 rd p-ch wr pu wr port wr pm ev dd p64 to p67 pu64 to pu67 output latch (p64 to p67) pm64 to pm67 selector internal bus pu6 pm6 p6 p6: port register 6 pu6: pull-up resistor option register 6 pm6: port mode register 6 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 150 5.2.7 port 7 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p70/ctxd p71/crxd p72/pcl/intp6 p73/buz/intp7 p74/so11 ? p75/si11 ? p76/sck11 ? remark : mounted, ? : not mounted port 7 is an 7-bit i/o port with an output latch. port 7 can be set to the input mode or output mode in 1-bit units using port mode register 7 (pm7). when the p70 to p76 pi ns are used as an input port, use of an on-chip pull-up resistor can be specified in 1-bit units by pull-up resistor option register 7 (pu7). this port can also be used for external interrupt reques t input, and clock output pins, buzzer output pins, can i/f i/o, serial interface data i/o, clock i/o. reset signal generation sets port 7 to input mode. figures 5-15 to 5-18 show block diagrams of port 7. caution to use p74/so11 and p76/sck11 as general- purpose ports, set serial operation mode register 10 (csim 10) and serial clock selection resister 10 (csic10) to the default status (00h).
chapter 5 port functions user?s manual u19180ej1v0ud 151 figure 5-15. block diagram of p70 and p74 wr pu rd wr port wr pm alternate function ev dd p-ch selector internal bus pu7 pm7 p7 p70/ctxd, p74/so11 pu70, pu74 output latch (p70, p74) pm70, pm74 p7: port register 7 pu7: pull-up resistor option register 7 pm7: port mode register 7 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 152 figure 5-16. block diagram of p71 and p75 p71/crxd p75/si11 wr pu rd wr port wr pm pu71 and pu75 alternate function output latch (p71 and p75) pm71 and pm75 ev dd p-ch selector internal bus pu7 pm7 p7 p7: port register 7 pu7: pull-up resistor option register 7 pm7: port mode register 7 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 153 figure 5-17. block diagram of p72 and p73 p72/pcl/intp6 p73/buz/intp7 wr pu rd wr port wr pm pu72 and pu73 alternate function output latch (p72 and p73) pm72 and pm73 alternate function ev dd p-ch selector internal bus pu7 pm7 p7 p7: port register 7 pu7: pull-up resistor option register 7 pm7: port mode register 7 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 154 figure 5-18. blo ck diagram of p76 p76/sck11 wr pu rd wr port wr pm pu76 output latch (p76) pm76 alternate function ev dd p-ch selector internal bus pu7 pm7 p7 alternate function p7: port register 7 pu7: pull-up resistor option register 7 pm7: port mode register 7 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 155 5.2.8 port 8 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p80/ani0 p81/ani1 p82/ani2 p83/ani3 p84/ani4 p85/ani4 p86/ani6 p87/ani7 remark : mounted port 8 is an 8-bit i/o port with an output latch. port 8 can be set to the input mode or output mode in 1-bit units using port mode register 8 (pm8). this port can also be used for a/d converter analog input. to use p80/ani0 to p87/ani7 as di gital input pins, set them in the di gital i/o mode by using the a/d port configuration register (adpc) and in the input mode by using pm8. use t hese pins starting from the lower bit. to use p80/ani0 to p87/ani7 as digi tal output pins, set them in the di gital i/o mode by using adpc and in the output mode by using pm8 (for details, see 13.3 (5) a/d port configuration register (adpc) ). table 5-5. setting functions of p80/ani0 to p87/ani7 pins adpc pm8 ads p80/ani0 to p87/ani7 pin input mode ? digital input digital i/o selection output mode ? digital output selects ani. analog input (to be converted) input mode does not select ani. analog input (not to be converted) selects ani. analog input selection output mode does not select ani. setting prohibited all p80/ani0 to p87/ani7 are set in the anal og input mode when the reset signal is generated. figure 5-19 shows a block diagram of port 8. caution make the av ref pin the same potential as the v dd pin when port 8 is used as a digital port.
chapter 5 port functions user?s manual u19180ej1v0ud 156 figure 5-19. block di agram of p80 to p87 internal bus p80/ani0 to p87/ani7 rd wr port wr pm output latch (p80 to p87) pm80 to pm87 selector pm8 a/d converter p8 p8: port register 8 pm8: port mode register 8 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 157 5.2.9 port 9 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 3 y = 4 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p80/ani0 ? p81/ani1 ? ? p82/ani2 ? ? p83/ani3 ? ? p84/ani4 ? ? ? p85/ani4 ? ? ? p86/ani6 ? ? ? p87/ani7 ? ? ? remark : mounted, ? : not mounted port 9 is an 8-bit i/o port with an output latch. port 9 can be set to the input mode or output mode in 1-bit units using port mode register 9 (pm9). this port can also be used for a/d converter analog input. to use p90/ani8 to p97/ani15 as digital input pins, set them in the digital i/o mode by using the a/d port configuration register (adpc) and in the input mode by using pm9. use t hese pins starting from the lower bit. to use p90/ani8 to p97/ani15 as digital output pins, set them in the digital i/o mode by using adpc and in the output mode by using pm9 (for details, see 13.3 (5) a/d port configuration register (adpc) ). table 5-6. setting functions of p90/ani8 to p97/ani15 pins adpc pm9 ads p90/ani8 to p97/ani15 pin input mode ? digital input digital i/o selection output mode ? digital output selects ani. analog input (to be converted) input mode does not select ani. analog input (not to be converted) selects ani. analog input selection output mode does not select ani. setting prohibited all p90/ani8 to p97/ani15 are set in the analog input mode when the reset signal is generated. figure 5-20 shows a block diagram of port 9. caution make the av ref pin the same potential as the v dd pin when port 9 is used as a digital port.
chapter 5 port functions user?s manual u19180ej1v0ud 158 figure 5-20. block di agram of p90 to p97 internal bus p90/ani8 to p97/ani15 rd wr port wr pm output latch (p90 to p97) pm90 to pm97 selector pm9 a/d converter p9 p9: port register 9 pm9: port mode register 9 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 159 5.2.10 port 12 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p120/intp0/exlvi p121/x1 p122/x2/exclk p123/xt1 p124/xt2/exclks remark : mounted port 12 is a 5-bit i/o port with an output latch. port 12 can be set to the input mode or output mode in 1-bit units using port mode register 12 (pm12). when used as an input por t only for p120, use of an on-chip pull-up resistor can be specified by pull-up resistor option register 12 (pu12). this port can also be used for external interrupt input, potential input for external low-voltage detector, connecting resonator for main system clock, connecti ng resonator for subsystem clock, exter nal clock input for main system clock, external clock input for subsystem clock. reset signal generation sets port 12 to input mode. figures 5-21 and 5-22 show block diagrams of port 12. cautions 1. when using the p121 to p124 pins to connect a resonato r for the main system clock (x1, x2) or subsystem clock (xt1, xt2), or to input an external clock for the main system clock (exclk) or subsystem clock (exclks), the x1 oscillation mode, xt1 oscillation mode, or external clock input mode must be set by us ing the clock operation mode select register (oscctl) (for detail, see 6.3 (5) clock operation mode select register (oscctl)). the reset value of oscctl is 00h (all of the p121 to p124 pins are i/o port pins). at this time, setting of the pm121 to pm124 and p121 to p124 pins is not necessary. 2. connect p121/x1 as follows when writin g the flash memory with a flash programmer. - p121/x1: when using this pin as a port, connect it to v ss via a resistor (10 k : recommended) (in the input mode) or leave it open (in the output mode). the above connection is no t necessary when writing the fl ash memory by means of self programming. remark x1 and x2 of the product can be used as on-chip debug mode setting pins (ocd0a, ocd0b) when the on-chip debug function is used. for how to connec t an on-chip debug emulator (qb-78k0mini or qb- mini2), see chapter 25 on-chip debug function .
chapter 5 port functions user?s manual u19180ej1v0ud 160 figure 5-21. blo ck diagram of p120 p120/intp0/exlvi wr pu rd wr port wr pm pu120 alternate function output latch (p120) pm120 ev dd p-ch selector internal bus pu12 pm12 p12 p12: port register 12 pu12: pull-up resistor option register 12 pm12: port mode register 12 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 161 figure 5-22. block di agram of p121 to p124 p122/x2/exclk, p124/xt2/exclks rd wr port wr pm output latch (p122/p124) pm122/pm124 pm12 p12 rd wr port wr pm output latch (p121/p123) pm121/pm123 pm12 p12 exclk, oscsel/ exclks, oscsels oscctl oscsel/ oscsels oscctl p121/x1, p123/xt1 oscsel/ oscsels oscctl oscsel/oscsels oscctl internal bus selector selector exclk/exclks oscctl p12: port register 12 pu12: pull-up resistor option register 12 pm12: port mode register 12 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 162 5.2.11 port 13 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 3 y = 4 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 p130 p131/ti003 ? p131 note p132/ti013/to03 ? ? note ti003 pin is not mounted. port function is provided. remark : mounted, ? : not mounted port 130 is a 1-bit output-only port. port 131 and 132 are 2-bit i/o port. p131 and p132 can be set to the input mode or output mode in 1-bit units using port mode register 13 (pm13). when used as an inpu t port, use of an on-chip pull-up resistor can be specified in 1-bit units by pull-up resistor option register 13 (pu13). figures 5-23 to 5-25 show block diagrams of port 13. figure 5-23. blo ck diagram of p130 rd output latch (p130) wr port p130 internal bus p13 p13: port register 13 rd: read signal wr : write signal remark when reset is effected, p130 outputs a low level. if p130 is set to output a high level before reset is effected, the output signal of p130 ca n be dummy-output as the cpu reset signal. p130 set by software reset signal
chapter 5 port functions user?s manual u19180ej1v0ud 163 figure 5-24. block diagram of p131 (1/2) (1) pd78f0884a, 78f0885a, 78f0886a, 78f 0894a, and 78f0895a of 78k0/fc2 rd p-ch wr pu wr port wr pm ev dd p131 pu131 output latch (p131) pm131 selector internal bus pu13 pm13 p13 p13: port register 13 pu13: pull-up resistor option register 13 pm13: port mode register 13 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 164 figure 5-24. block diagram of p131 (2/2) (1) 78k0/ff2, 78f0/fe2 p131/ti003 wr pu rd wr port wr pm alternate function output latch (p131) ev dd p-ch selector internal bus pu13 pm13 pu131 pm131 p13 p13: port register 13 pu13: pull-up resistor option register 13 pm13: port mode register 13 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 165 figure 5-25. blo ck diagram of p132 p132/ti013/to03 wr pu rd wr port wr pm pu132 alternate function output latch (p132) pm132 alternate function ev dd p-ch selector internal bus pu13 pm13 p13 p13: port register 13 pu13: pull-up resistor option register 13 pm13: port mode register 13 rd: read signal wr : write signal
chapter 5 port functions user?s manual u19180ej1v0ud 166 5.3 registers controlling port function port functions are controlled by the following four types of registers. ? port mode registers (pmxx) ? port registers (pxx) ? pull-up resistor option registers (puxx) ? a/d port configuration register (adpc)
chapter 5 port functions user?s manual u19180ej1v0ud 167 (1) port mode registers (pmxx) these registers specify input or output mode for the port in 1-bit units. these registers can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation sets these registers to ffh except for pm13. pm13 is set to feh. when port pins are used as alternate-function pins, set t he port mode register and output latch as shown in table 5-7. figure 5-26. format of port mode register (78k0/fc2) 7 pm17 pm1 6 pm16 5 pm15 4 pm14 3 pm13 2 pm12 1 pm11 0 pm10 ff21h ffh r/w 7 1 pm3 6 1 5 1 4 1 3 pm33 2 pm32 1 pm31 0 pm30 ff23h ffh r/w 7 1 pm4 6 1 5 1 4 1 3 1 2 1 1 pm41 0 pm40 ff24h ffh r/w 7 1 pm7 6 1 5 1 4 1 3 pm73 2 pm72 1 pm71 0 pm70 ff27h ffh r/w 7 pm87 pm8 6 pm86 5 pm85 4 pm84 3 pm83 2 pm82 1 pm81 0 pm80 ff28h ffh r/w 7 1 pm12 6 1 5 1 4 pm124 3 pm123 2 pm122 1 pm121 0 pm120 ff2ch ffh r/w 7 1 symbol pm0 6 pm06 5 1 4 1 3 1 2 1 1 pm01 0 pm00 address ff20h after reset ffh r/w r/w note 7 1 pm9 6 1 5 1 4 1 3 1 2 1 1 1 0 pm90 ff29h ffh r/w note 7 1 pm6 6 1 5 1 4 1 3 pm63 2 pm62 1 pm61 0 pm60 ff26h ffh r/w note 7 1 pm13 6 1 5 1 4 1 3 1 2 1 1 pm131 0 0 ff2dh feh r/w note pmmn pmn pin i/o mode selection (m = 0, 1, 3, 4, 6 to 9, 12, 13; n = 0 to 7) 0 output mode (output buffer on) 1 input mode (output buffer off) note pm06, pm63, pm90, pm131 are pd78f0884a, 78f0885a, 78f0886a, 78f0894a, and 78f0895a only. be sure to clear bit 6 of pm0, bit 3 of pm6, bit 0 of pm9 and bit 1 of pm13 to 1 at pd78f0881a, 78f0882a, 78f0883a.
chapter 5 port functions user?s manual u19180ej1v0ud 168 figure 5-27. format of port mode register (78k0/fe2) 7 1 symbol pm0 6 pm06 5 pm05 4 1 3 1 2 1 1 pm01 0 pm00 address ff20h after reset ffh r/w r/w 7 pm17 pm1 6 pm16 5 pm15 4 pm14 3 pm13 2 pm12 1 pm11 0 pm10 ff21h ffh r/w 7 1 pm3 6 1 5 1 4 1 3 pm33 2 pm32 1 pm31 0 pm30 ff23h ffh r/w 7 1 pm4 6 1 5 1 4 1 3 pm43 2 pm42 1 pm41 0 pm40 ff24h ffh r/w 7 1 pm5 6 1 5 1 4 1 3 pm53 2 pm52 1 pm51 0 pm50 ff25h ffh r/w 7 1 pm6 6 1 5 1 4 1 3 pm63 2 pm62 1 pm61 0 pm60 ff26h ffh r/w 7 1 pm7 6 pm76 5 pm75 4 pm74 3 pm73 2 pm72 1 pm71 0 pm70 ff27h ffh r/w 7 pm87 pm8 6 pm86 5 pm85 4 pm84 3 pm83 2 pm82 1 pm81 0 pm80 ff28h ffh r/w 7 1 pm9 6 1 5 1 4 1 3 pm93 2 pm92 1 pm91 0 pm90 ff29h ffh r/w 7 1 pm12 6 1 5 1 4 pm124 3 pm123 2 pm122 1 pm121 0 pm120 ff2ch ffh r/w 7 1 pm13 6 1 5 1 4 1 3 1 2 pm132 1 pm131 0 0 ff2dh feh r/w pmmn pmn pin i/o mode selection (m = 0, 1, 3 to 9, 12, 13; n = 0 to 7) 0 output mode (output buffer on) 1 input mode (output buffer off)
chapter 5 port functions user?s manual u19180ej1v0ud 169 figure 5-28. format of port mode register (78k0/ff2) 7 1 symbol pm0 6 pm06 5 pm05 4 1 3 1 2 1 1 pm01 0 pm00 address ff20h after reset ffh r/w r/w 7 pm17 pm1 6 pm16 5 pm15 4 pm14 3 pm13 2 pm12 1 pm11 0 pm10 ff21h ffh r/w 7 1 pm3 6 1 5 1 4 1 3 pm33 2 pm32 1 pm31 0 pm30 ff23h ffh r/w 7 pm47 pm4 6 pm46 5 pm45 4 pm44 3 pm43 2 pm42 1 pm41 0 pm40 ff24h ffh r/w 7 pm57 pm5 6 pm56 5 pm55 4 pm54 3 pm53 2 pm52 1 pm51 0 pm50 ff25h ffh r/w 7 pm67 pm6 6 pm66 5 pm65 4 pm64 3 pm63 2 pm62 1 pm61 0 pm60 ff26h ffh r/w 7 1 pm7 6 pm76 5 pm75 4 pm74 3 pm73 2 pm72 1 pm71 0 pm70 ff27h ffh r/w 7 pm87 pm8 6 pm86 5 pm85 4 pm84 3 pm83 2 pm82 1 pm81 0 pm80 ff28h ffh r/w 7 pm97 pm9 6 pm96 5 pm95 4 pm94 3 pm93 2 pm92 1 pm91 0 pm90 ff29h ffh r/w 7 1 pm12 6 1 5 1 4 pm124 3 pm123 2 pm122 1 pm121 0 pm120 ff2ch ffh r/w 7 1 pm13 6 1 5 1 4 1 3 1 2 pm132 1 pm131 0 0 ff2dh feh r/w pmmn pmn pin i/o mode selection (m = 0, 1, 3 to 9, 12, 13; n = 0 to 7) 0 output mode (output buffer on) 1 input mode (output buffer off)
chapter 5 port functions user?s manual u19180ej1v0ud 170 (2) port registers (pxx) these registers write the data t hat is output from the chip when data is output from a port. if the data is read in the input mode, the pin level is read. if it is read in the output mode, the value of the output latch is read. these registers can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears these registers to 00h. figure 5-29. format of port register (78k0/fc2) 7 0 symbol p0 6 p06 5 0 4 0 3 0 2 0 1 p01 0 p00 address ff00h after reset 00h (output latch) r/w r/w 7 p17 p1 6 p16 5 p15 4 p14 3 p13 2 p12 1 p11 0 p10 ff01h 00h (output latch) r/w 7 0 p3 6 0 5 0 4 0 3 p33 2 p32 1 p31 0 p30 ff03h 00h (output latch) r/w 7 0 p4 6 0 5 0 4 0 3 0 2 0 1 p41 0 p40 ff04h 00h (output latch) r/w 7 0 p7 6 0 5 0 4 0 3 p73 2 p72 1 p71 0 p70 ff07h 00h (output latch) r/w 7 0 p12 6 0 5 0 4 p124 3 p123 2 p122 1 p121 0 p120 ff0ch 00h (output latch) r/w 7 p87 p8 6 p86 5 p85 4 p84 3 p83 2 p82 1 p81 0 p80 ff08h 00h (output latch) r/w r/w note 7 0 p6 6 0 5 0 4 0 3 p63 2 p62 1 p61 0 p60 ff06h 00h (output latch) r/w note 7 0 p9 6 0 5 0 4 0 3 0 2 0 1 0 0 p90 ff09h 00h (output latch) note 7 0 p13 6 0 5 0 4 0 3 0 2 0 1 p131 0 p130 ff0dh 00h (output latch) r/w note m = 0, 1, 3, 4, 6 to 9, 12, 13; n = 0 to 7 pmn output data control (in output mode) input data read (in input mode) 0 output 0 input low level 1 output 1 input high level note p06, p63, p90, p131 are pd78f0884a, 78f0885a, 78f0886a, 78f0894a, a nd 78f0895a only. be sure to clear bit 6 of p0, bit 3 of p6, bit 0 to p9 and bit 1 of p13 to 0 at pd78f0881a, 78f0882a, 78f0883a.
chapter 5 port functions user?s manual u19180ej1v0ud 171 figure 5-30. format of port register (78k0/fe2) 7 0 symbol p0 6 p06 5 p05 4 0 3 0 2 0 1 p01 0 p00 address ff00h after reset 00h (output latch) r/w r/w 7 p17 p1 6 p16 5 p15 4 p14 3 p13 2 p12 1 p11 0 p10 ff01h 00h (output latch) r/w 7 0 p9 6 0 5 0 4 0 3 p93 2 p92 1 p91 0 p90 ff09h 7 0 p3 6 0 5 0 4 0 3 p33 2 p32 1 p31 0 p30 ff03h 00h (output latch) r/w 7 0 p4 6 0 5 0 4 0 3 p43 2 p42 1 p41 0 p40 ff04h 00h (output latch) r/w 7 0 p5 6 0 5 0 4 0 3 p53 2 p52 1 p51 0 p50 ff05h 00h (output latch) r/w 7 0 p6 6 0 5 0 4 0 3 p63 2 p62 1 p61 0 p60 ff06h 00h (output latch) r/w 7 0 p7 6 p76 5 p75 4 p74 3 p73 2 p72 1 p71 0 p70 ff07h 00h (output latch) r/w 7 0 p12 6 0 5 0 4 p124 3 p123 2 p122 1 p121 0 p120 ff0ch 00h (output latch) r/w 7 0 p13 6 0 5 0 4 0 3 0 2 p132 1 p131 0 p130 ff0dh 00h (output latch) r/w 7 p87 p8 6 p86 5 p85 4 p84 3 p83 2 p82 1 p81 0 p80 ff08h 00h (output latch) 00h (output latch) r/w r/w m = 0, 1, 3 to 9, 12, 13; n = 0 to 7 pmn output data control (in output mode) input data read (in input mode) 0 output 0 input low level 1 output 1 input high level remark an undefined value (pin input leve l) is read for the value after reset when p0 is read in the input mode. when p8 and p9 are read in the output m ode, 00h (output latch value) is output.
chapter 5 port functions user?s manual u19180ej1v0ud 172 figure 5-31. format of port register (78k0/ff2) 7 0 symbol p0 6 p06 5 p05 4 0 3 0 2 0 1 p01 0 p00 address ff00h after reset 00h (output latch) r/w r/w 7 p17 p1 6 p16 5 p15 4 p14 3 p13 2 p12 1 p11 0 p10 ff01h 00h (output latch) r/w 7 p97 p9 6 p96 5 p95 4 p94 3 p93 2 p92 1 p91 0 p90 ff09h 7 0 p3 6 0 5 0 4 0 3 p33 2 p32 1 p31 0 p30 ff03h 00h (output latch) r/w 7 p47 p4 6 p46 5 p45 4 p44 3 p43 2 p42 1 p41 0 p40 ff04h 00h (output latch) r/w 7 p57 p5 6 p56 5 p55 4 p54 3 p53 2 p52 1 p51 0 p50 ff05h 00h (output latch) r/w 7 p67 p6 6 p66 5 p65 4 p64 3 p63 2 p62 1 p61 0 p60 ff06h 00h (output latch) r/w 7 0 p7 6 p76 5 p75 4 p74 3 p73 2 p72 1 p71 0 p70 ff07h 00h (output latch) r/w 7 0 p12 6 0 5 0 4 p124 3 p123 2 p122 1 p121 0 p120 ff0ch 00h (output latch) r/w 7 0 p13 6 0 5 0 4 0 3 0 2 p132 1 p131 0 p130 ff0dh 00h (output latch) r/w 7 p87 p8 6 p86 5 p85 4 p84 3 p83 2 p82 1 p81 0 p80 ff08h 00h (output latch) 00h (output latch) r/w r/w remark an undefined value (pin input level) is read for the value after reset when p0 is read in the input mode. when p8 and p9 are read in the output m ode, 00h (output latch value) is output. m = 0, 1, 3 to 9, 12, 13; n = 0 to 7 pmn output data control (in output mode) input data read (in input mode) 0 output 0 input low level 1 output 1 input high level
chapter 5 port functions user?s manual u19180ej1v0ud 173 (3) pull-up resistor option registers (puxx) these registers specify whether the on-chip pull-up resistors are to be us ed or not. on-chip pull-up resistors can be used in 1-bit units only for the bits set to input mode of the pins to which the use of an on-chip pull-up resistor has been specified in these registers. on -chip pull-up resistors cannot be connect ed to bits set to output mode and bits used as alternate-function output pins, regar dless of the settings of these registers. these registers can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears these registers to 00h. figure 5-32. format of pull-up resist or option register (78k0/fc2) 7 pu17 pu1 6 pu16 5 pu15 4 pu14 3 pu13 2 pu12 1 pu11 0 pu10 ff31h 00h r/w 7 0 pu3 6 0 5 0 4 0 3 pu33 2 pu32 1 pu31 0 pu30 ff33h 00h r/w 7 0 pu4 6 0 5 0 4 0 3 0 2 0 1 pu41 0 pu40 ff34h 00h r/w 7 0 pu7 6 pu76 5 pu75 4 pu74 3 pu73 2 pu72 1 pu71 0 pu70 ff37h 00h r/w 7 0 pu12 6 0 5 0 4 0 3 0 2 0 1 0 0 pu120 ff3ch 00h r/w 7 0 pu13 6 0 5 0 4 0 3 0 2 0 1 pu131 0 0 ff3dh 00h r/w 7 0 symbol pu0 6 pu06 5 0 4 0 3 0 2 0 1 pu01 0 pu00 address ff30h after reset 00h r/w r/w note note pumn pumn pin on-chip pull-up resistor selection (m = 0, 1, 3, 4, 7, 12, 13, n = 0 to 7) 0 on-chip pull-up resistor not connected 1 on-chip pull-up resistor connected note pu06 and pu131 are pd78f0884, 78f0885, 78f0886, 78f0894 and 78f0895a only. be sure to clear bit 6 of pu0 and bit 1 of pu13 to 0 at pd78f0881a, 78f0882a, 78f0883a.
chapter 5 port functions user?s manual u19180ej1v0ud 174 figure 5-33. format of pull-up resist or option register (78k0/fe2) 7 0 symbol pu0 6 pu06 5 pu05 4 0 3 0 2 0 1 pu01 0 pu00 address ff30h after reset 00h r/w r/w 7 pu17 pu1 6 pu16 5 pu15 4 pu14 3 pu13 2 pu12 1 pu11 0 pu10 ff31h 00h r/w 7 0 pu3 6 0 5 0 4 0 3 pu33 2 pu32 1 pu31 0 pu30 ff33h 00h r/w 7 0 pu4 6 0 5 0 4 0 3 pu43 2 pu42 1 pu41 0 pu40 ff34h 00h r/w 7 0 pu5 6 0 5 0 4 0 3 pu53 2 pu52 1 pu51 0 pu50 ff35h 00h r/w 7 0 pu7 6 pu76 5 pu75 4 pu74 3 pu73 2 pu72 1 pu71 0 pu70 ff37h 00h r/w 7 0 pu12 6 0 5 0 4 0 3 0 2 0 1 0 0 pu120 ff3ch 00h r/w 7 0 pu13 6 0 5 0 4 0 3 0 2 pu132 1 pu131 0 0 ff3dh 00h r/w pumn pumn pin on-chip pull-up resistor selection (m = 0, 1, 3 to 5, 7, 12, 13, n = 0 to 7) 0 on-chip pull-up resistor not connected 1 on-chip pull-up resistor connected
chapter 5 port functions user?s manual u19180ej1v0ud 175 figure 5-34. format of pull-up resi stor option register (78k0/ff2) 7 0 symbol pu0 6 pu06 5 pu05 4 0 3 0 2 0 1 pu01 0 pu00 address ff30h after reset 00h r/w r/w 7 pu17 pu1 6 pu16 5 pu15 4 pu14 3 pu13 2 pu12 1 pu11 0 pu10 ff31h 00h r/w 7 0 pu3 6 0 5 0 4 0 3 pu33 2 pu32 1 pu31 0 pu30 ff33h 00h r/w 7 pu47 pu4 6 pu46 5 pu45 4 pu44 3 pu43 2 pu42 1 pu41 0 pu40 ff34h 00h r/w 7 pu57 pu5 6 pu56 5 pu55 4 pu54 3 pu53 2 pu52 1 pu51 0 pu50 ff35h 00h r/w 7 0 pu7 6 pu76 5 pu75 4 pu74 3 pu73 2 pu72 1 pu71 0 pu70 ff37h 00h r/w 7 0 pu12 6 0 5 0 4 0 3 0 2 0 1 0 0 pu120 ff3ch 00h r/w 7 0 pu13 6 0 5 0 4 0 3 0 2 pu132 1 pu131 0 0 ff3dh 00h r/w 7 pu67 pu6 6 pu66 5 pu65 4 pu64 3 0 2 0 1 0 0 0 ff36h 00h r/w pumn pumn pin on-chip pull-up resistor selection (m = 0, 1, 3 to 7, 12, 13, n = 0 to 7) 0 on-chip pull-up resistor not connected 1 on-chip pull-up resistor connected
chapter 5 port functions user?s manual u19180ej1v0ud 176 (4) a/d port configuration register (adpc) this register switches the p80/ani0 to p87/ani7, p90/ani8 to p97/ani15 pi ns to analog input of a/d converter or digital i/o of port. adpc can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears this register to 00h. remark p80/ani0 to p87/ani7 pins: 44-pin products of 78k0/fc2 p80/ani0 to p87/ani7, p90/ani8 pins: 48-pin products of 78k0/fc2 p80/ani0 to p87/ani7, p90/ani8 to p93/ani11 pins: 78k0/fe2 p80/ani0 to p87/ani7, p90/ani8 to p97/ani15 pins: 78k0/ff2
chapter 5 port functions user?s manual u19180ej1v0ud 177 figure 5-35. format of a/d port configuration register (adpc) address: ff22h after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 adpc 0 0 0 adpc4 adpc3 adpc2 adpc1 adpc0 analog input (a)/ digita l input (d) switching a d p c 4 a d p c 3 a d p c 2 a d p c 1 a d p c 0 p97/ ani15 p96/ ani14 p95/ ani13 p94/ ani12 p93/ ani11 p92/ ani10 p91/ ani9 p90/ ani8 p87/ ani7 p86/ ani6 p85/ ani5 p84/ ani4 p83/ ani3 p82/ ani2 p81/ ani1 p80/ ani0 0 0 0 0 0 a a a a a a a a a a a a a a a a 0 0 0 0 1 a a a a a a a a a a a a a a a d 0 0 0 1 0 a a a a a a a a a a a a a a d d 0 0 0 1 1 a a a a a a a a a a a a a d d d 0 0 1 0 0 a a a a a a a a a a a a d d d d 0 0 1 0 1 a a a a a a a a a a a d d d d d 0 0 1 1 0 a a a a a a a a a a d d d d d d 0 0 1 1 1 a a a a a a a a a d d d d d d d 0 1 0 0 0 a a a a a a a a d d d d d d d d 0 1 0 0 1 a a a a a a a d d d d d d d d d 0 1 0 1 0 a a a a a a d d d d d d d d d d 0 1 0 1 1 a a a a a d d d d d d d d d d d 0 1 1 0 0 a a a a d d d d d d d d d d d d 0 1 1 0 1 a a a d d d d d d d d d d d d d 0 1 1 1 0 a a d d d d d d d d d d d d d d 0 1 1 1 1 a d d d d d d d d d d d d d d d 1 0 0 0 0 d d d d d d d d d d d d d d d d other than above setting prohibited notes 1. setting permitted 2. setting prohibited cautions 1. set the channel used for a/d conversion to the input m ode by using port mode register 8 (pm8) and port mode register 9 (pm9). 2. do not set the pin set by adpc as digi tal i/o by analog inpu t channel specification register (ads). 3. if data is written to adpc, a wait cycle is generated. do not write data to adpc when the cpu is operating on the subsystem clock and th e peripheral hardware clock is stopped. for details, see chapter 31 cautions for wait. remark p80/ani0 to p87/ani7 pins: 44-pin products of 78k0/fc2 p80/ani0 to p87/ani7, p90/ani8 pins: 48-pin products of 78k0/fc2 p80/ani0 to p87/ani7, p90/ani8 to p93/ani11 pins: 78k0/fe2 p80/ani0 to p87/ani7, p90/ani8 to p97/ani15 pins: 78k0/ff2 fe2 note 1 note 1 note 2 note 2 note 1 48-pin of fc2 note 1 note 2 ff2 44-pin of fc2
chapter 5 port functions user?s manual u19180ej1v0ud 178 5.4 port function operations port operations differ depending on whether the inpu t or output mode is set, as shown below. 5.4.1 writing to i/o port (1) output mode a value is written to the output latch by a transfer instruct ion, and the output latch content s are output from the pin. once data is written to the output latch, it is reta ined until data is written to the output latch again. the data of the output latch is cleared by reset. (2) input mode a value is written to the output latch by a transfer instruction, but since the output buffer is off, the pin status does not change. once data is written to the output latch, it is reta ined until data is written to the output latch again. 5.4.2 reading from i/o port (1) output mode the output latch contents ar e read by a transfer instruction. t he output latch content s do not change. (2) input mode the pin status is read by a transfer instruct ion. the output latch c ontents do not change. 5.4.3 operations on i/o port (1) output mode an operation is performed on the output latch contents, and the result is wr itten to the output latch. the output latch contents are output from the pins. once data is written to the output latch, it is reta ined until data is written to the output latch again. the data of the output latch is cleared by reset. (2) input mode the pin level is read and an operation is performed on its cont ents. the result of the op eration is written to the output latch, but since the output buffer is off, the pin status does not change.
chapter 5 port functions user?s manual u19180ej1v0ud 179 5.5 settings of port mode register and output latch when using alternate function to use the alternate function of a por t pin, set the port mode register and output latch as shown in table 5-7. remark the port pins mounted depend on the product. see table 5-3. port functions . table 5-7. settings of port mode register a nd output latch when using alternate function (1/2) alternate function pin name function name i/o pm p p00 ti000 input 1 ti010 input 1 p01 to00 output 0 0 ssi11 input 1 p05 ti001 input 1 ti011 input 1 p06 to01 output 0 0 input 1 sck10 output 0 1 p10 txd61 output 0 1 si10 input 1 p11 rxd61 input 1 p12 so10 output 0 0 p13 txd60 output 0 1 p14 rxd60 input 1 p15 toh0 output 0 0 toh1 output 0 0 p16 intp5 input 1 ti50 input 1 p17 to50 output 0 0 p30 intp1 input 1 intp2 input 1 p31 ti002 input 1 intp3 input 1 ti012 input 1 p32 to02 output 0 0 intp4 input 1 ti51 input 1 p33 to51 output 0 0 p70 ctxd output 0 1 p71 crxd input 1 pcl output 0 0 p72 intp6 input 1 remark : don?t care pm : port mode register p : port output latch
chapter 5 port functions user?s manual u19180ej1v0ud 180 table 5-7. settings of port mode register a nd output latch when using alternate function (2/2) alternate function pin name function name i/o pm p buz output 0 0 p73 intp7 input 1 p74 so11 output 0 0 p75 si11 input 1 input 1 p76 sck11 output 0 1 p80-p87 ani0-ani7 input 1 p90-p97 ani8-ani15 input 1 intp0 input 1 p120 exlvi input 1 p121 x1 input 1 x2 input 1 p122 exclk input 1 p123 xt1 input 1 xt2 input 1 p124 exclks input 1 p131 ti003 input 1 ti013 input 1 p132 to03 output 0 0 remark : don?t care pm : port mode register p : port output latch when using p80/ani0 to p87/ani7, p90/ani8 to p97/ani15 in the input mode, not only pm8 and pm9 (input/output) but also the a/d port confi guration register (adpc) (analog input/dig ital input) must be set (for details, see 13.3 (4) analog input channel specific ation register (ads) to (7) port mode r egister 9 (pm9)). the reset value of adpc is 00h (p80/ani0 to p87/ani7, p90/ani8 to p97/ani15 are all analog input pins).
chapter 5 port functions user?s manual u19180ej1v0ud 181 5.6 cautions on 1-bit manipulation in struction for port register n (pn) when a 1-bit manipulation instruction is executed on a por t that provides both input and output functions, the output latch value of an input port that is not subject to manipulation may be written in addition to the targeted bit. therefore, it is recommended to rewr ite the output latch when switching a port from input mode to output mode. when p10 is an output port, p11 to p17 are input ports (all pin statuses are high level), and the port latch value of port 1 is 00h, if the output of output port p10 is changed from low level to high level via a 1-bit manipulation instruction, t he output latch value of port 1 is ffh. explanation: the targets of writing to and reading from the pn register of a port whose pmnm bit is 1 are the output latch and pin status, respectively. a 1-bit manipulation instruction is executed in t he following order in the 78k0/fx2 microcontrollers. <1> the pn register is read in 8-bit units. <2> the targeted one bit is manipulated. <3> the pn register is written in 8-bit units. in step <1>, the output latch value (0) of p10, whic h is an output port, is read, while the pin statuses of p11 to p17, which are input ports, are read. if the pin statuses of p11 to p17 are high level at this time, the read value is feh. the value is changed to ffh by the manipulation in <2>. ffh is written to the output la tch by the manipulation in <3>. figure 5-36. bit manipu lation instruction (p10) low-level output 1-bit manipulation instruction (set1 p1.0) is executed for p10 bit. pin status: high level p10 p11 to p17 port 1 output latch 00000000 high-level output pin status: high level p10 p11 to p17 port 1 output latch 11111111 1-bit manipulation instruction for p10 bit <1> port register 1 (p1) is read in 8-bit units. ? in the case of p10, an output port, the value of the port output latch (0) is read. ? in the case of p11 to p17, input ports, the pin status (1) is read. <2> set the p10 bit to 1. <3> write the results of <2> to the output latch of port register 1 (p1) in 8-bit units.
user?s manual u19180ej1v0ud 182 chapter 6 clock generator 6.1 functions of clock generator the clock generator generates the clock to be supplied to the cpu and peripheral hardware. the following system clocks and cl ock oscillators are selectable. (1) main system clock <1> x1 oscillator this circuit oscillates a clock of f x = 4 to 20 mhz. oscillation can be stopped by executing the stop instruction or using the main osc control register (moc). <2> internal high-speed oscillator this circuit oscillates a clock of f rh = 8 mhz (typ.). after a reset release, the cpu always starts operating with this internal high-speed oscillation clock. oscillation can be stopped by executing the stop instruction or using the internal oscillator mode register (rcm). an external main system clock (f exclk = 4 to 20 mhz) can also be supplied from the exclk pin. as the main system clock, a high-speed system clock (x1 clock or external main system clock) or internal high-speed oscillation clock can be selected by using the main clock mode register (mcm). (2) subsystem clock ? subsystem clock oscillator this circuit oscillates at a frequency of f xt = 32.768 khz by connecting a 32.768 khz resonator across xt1 and xt2. oscillation can be stopped by using the processor clock control register (pcc) and clock operation mode select register (oscctl). an external subsystem clock (f exclks = 32.768 khz) can also be supplied from the exclks pin. (3) internal low-speed oscillation clock (clock for watchdog timer) ? internal low-speed oscillator this circuit oscillates a clock of f rl = 240 khz (typ.). after a reset releas e, the internal low-speed oscillation clock always starts operating. oscillation can be stopped by using the internal oscill ation mode register (rcm) when ?internal low-speed oscillator can be stopped by software? is set by option byte. the internal low-speed oscillation clock cannot be us ed as the cpu clock. the following hardware operates with the internal low-speed oscillation clock. ? watchdog timer ? tmh1 (when f rl , f rl /2 7 , or f rl /2 9 is selected) remarks 1. f x : x1 clock oscillation frequency 2. f rh : internal high-speed oscillation clock frequency 3. f exclk : external main system clock frequency 4. f xt : xt1 clock oscillation frequency 5. f exclks : external subsystem clock frequency 6. f rl : internal low-speed oscillation clock frequency
chapter 6 clock generator user?s manual u19180ej1v0ud 183 6.2 configuration of clock generator the clock generator includes the following hardware. table 6-1. configuration of clock generator item configuration control registers processor cl ock control register (pcc) internal oscillator mode register (rcm) main clock mode register (mcm) main osc control register (moc) clock operation mode select register (oscctl) oscillation stabilization time count er status register (ostc) oscillation stabilization time select register (osts) oscillators x1 oscillator xt1 oscillator internal high-speed oscillator internal low-speed oscillator
chapter 6 clock generator user?s manual u19180ej1v0ud 184 figure 6-1. block diagram of clock generator option byte 1: cannot be stopped 0: can be stopped internal oscillato r mode register (rcm) lsrstop rsts rstop internal high-speed oscillator (8 mhz (typ.)) internal low-speed oscillator (240 khz (typ.)) f rl clock operation mode select register (oscctl) oscsels exclks xt1/p123 xt2/exclks/ p124 f sub peripheral hardware clock (f prs ) watchdog timer, 8-bit timer h1 watch timer 1/2 cpu clock (f cpu ) processor clock control register (pcc) css pcc2 cls pcc1 pcc0 prescaler main system clock switch f xp peripheral hardware clock switch x1 oscillation stabilization time counter osts1 osts0 osts2 oscillation stabilization time select register (osts) 3 most 16 most 15 most 14 most 13 most 11 oscillation stabilization time counter status register (ostc) controller mcm0 xsel mcs mstop stop exclk oscsel amph clock operation mode select register (oscctl) 4 f xp 2 f xp 2 2 f xp 2 3 f xp 2 4 main clock mode register (mcm) main clock mode register (mcm) main osc control register (moc) f rh internal bus internal bus high-speed system clock oscillator crystal/ceramic oscillation external input clock x1/p121 x2/exclk/ p122 f xh f sub 2 crystal oscillation external input clock subsystem clock oscillator f x f exclk f xt f exclks selector
chapter 6 clock generator user?s manual u19180ej1v0ud 185 remark f x : x1 clock oscillation frequency f rh : internal high-speed oscillation clock frequency f exclk : external main system clock frequency f xh : high-speed system clock oscillation frequency f xp : main system clock oscillation frequency f prs : peripheral hardware clock frequency f cpu : cpu clock oscillation frequency f xt : xt1 clock oscillation frequency f exclks : external subsystem clock frequency f sub : subsystem clock frequency f rl : internal low-speed oscillation clock frequency 6.3 registers controlling clock generator the following seven registers are us ed to control the clock generator. ? processor clock control register (pcc) ? internal oscillator mode register (rcm) ? main clock mode register (mcm) ? main osc control register (moc) ? clock operation mode select register (oscctl) ? oscillation stabilization time c ounter status register (ostc) ? oscillation stabilization time select register (osts) (1) processor clock control register (pcc) this register is used to select t he cpu clock and the division ratio. pcc is set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation sets pcc to 01h.
chapter 6 clock generator user?s manual u19180ej1v0ud 186 figure 6-2. format of processor clock control register (pcc) address: fffbh after reset: 01h r/w note 1 symbol 7 6 <5> <4> 3 2 1 0 pcc 0 0 cls css 0 pcc2 pcc1 pcc0 cls cpu clock status 0 main system clock 1 subsystem clock notes 1. bit 5 is read-only. 2. be sure to switch css from 1 to 0 when bits 1 (mcs) and 0 (mcm0) of the main clock mode register (mcm) are 1. caution be sure to clear bits 3, 6 and 7 to 0. remarks 1. f xp : main system clock oscillation frequency 2. f sub : subsystem clock frequency the fastest instruction can be executed in 2 clocks of the cpu clock in the 78k0/fx2 microcontrolle rs. therefore, the relationship between the cpu clock (f cpu ) and the minimum instruction execution time is as shown in table 6- 2. table 6-2. relationship between cpu clo ck and minimum instruction execution time minimum instruction execution time: 2/f cpu high-speed system clock note internal high-speed oscillation clock note subsystem clock cpu clock (f cpu ) at 10 mhz operation at 20 mhz operation at 8 mhz (typ.) operation at 32.768 khz operation f xp 0.2 s 0.1 s 0.25 s (typ.) ? f xp /2 0.4 s 0.2 s 0.5 s (typ.) ? f xp /2 2 0.8 s 0.4 s 1.0 s (typ.) ? f xp /2 3 1.6 s 0.8 s 2.0 s (typ.) ? f xp /2 4 3.2 s 1.6 s 4.0 s (typ.) ? f sub /2 ? ? 122.1 s note the main clock mode register (mcm) is used to set the cpu clock (high-speed system clock/internal high-speed oscillation clock) (see figure 6-4 ). css note 2 pcc2 pcc1 pcc0 cpu clock (f cpu ) selection 0 0 0 f xp 0 0 1 f xp /2 (default) 0 1 0 f xp /2 2 0 1 1 f xp /2 3 0 1 0 0 f xp /2 4 0 0 0 0 0 1 0 1 0 0 1 1 1 1 0 0 f sub /2 other than above setting prohibited
chapter 6 clock generator user?s manual u19180ej1v0ud 187 (2) internal oscillator mode register (rcm) this register sets the operation mode of internal oscillator. rcm can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation sets this register to 80h note 1 . figure 6-3. format of internal oscillator mode register (rcm) address: ffa0h after reset: 80h note 1 r/w note 2 symbol <7> 6 5 4 3 2 <1> <0> rcm rsts 0 0 0 0 0 lsrstop rstop rsts status of internal high-speed oscillator oscillation 0 waiting for stabilization of internal high-speed oscillator oscillation in high-accuracy mode (internal high-speed oscillator operation in low-accuracy mode) 1 internal high-speed oscillator operation in high-accuracy mode lsrstop internal low-speed oscillator oscillating/stopped 0 internal low-speed oscillator 1 internal low-speed oscillator stopped rstop internal high-speed oscillator oscillating/stopped 0 internal high-speed oscillator oscillating 1 internal high-speed oscillator stopped notes 1. the value of this register is 00h immedi ately after a reset release but automatically changes to 80h after internal high-speed oscillator oscillation has been stabilized. 2. bit 7 is read-only. caution when setting rstop to 1, be sure to confirm that the cpu operates with a clock other than the internal high-speed oscill ation clock. specifically, set rstop to 1 under either of the following conditions. ? when mcs = 1 (when cpu operates with the high-speed system clock) ? when cls = 1 (when cpu operates with the subsystem clock)
chapter 6 clock generator user?s manual u19180ej1v0ud 188 (3) main clock mode register (mcm) this register selects the main syst em clock supplied to cpu clock and clock supplied to peripheral hardware clock. mcm can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears this register to 00h. figure 6-4. format of main clock mode register (mcm) address: ffa1h after reset: 00h r/w note symbol 7 6 5 4 3 <2> <1> <0> mcm 0 0 0 0 0 xsel mcs mcm0 selection of clock supplied to main system clock and peripheral hardware xsel mcm0 main system clock (f xp ) peripheral hardware clock (f prs ) 0 0 0 1 internal high-speed oscillation clock (f rh ) 1 0 internal high-speed oscillation clock (f rh ) 1 1 high-speed system clock (f xh ) high-speed system clock (f xh ) mcs main system clock status 0 operates with internal high-speed oscillation clock 1 operates with high-speed system clock note bit 1 is read-only. cautions 1. xsel can be change d only once after a reset release. 2. the peripheral hardware cannot operate when the peripheral hardware clock is stopped. to resume the operation of the peripheral hardware after the peripheral hardware clock has been stopped, initialize the peripheral hardware. 3. a clock other than f prs is supplied to the following peripheral functions regardless of the se tting of xsel and mcm0. ? watchdog timer ? when ?f rl /2 7 ? is selected as the count clock for 8-bit timer h1 ? peripheral hardware selects the external clock as the clock source (except when the external count clock of tm 0n (n = 0, 1) is selected (ti00n pin valid edge)) 4. it takes one clock to change the cpu clock.
chapter 6 clock generator user?s manual u19180ej1v0ud 189 (4) main osc control register (moc) this register selects the operation mode of the high-speed system clock. this register is used to stop the x1 oscillator or to disable an external clock input from the exclk pin when the cpu operates with a clock other than the high-speed system clock. moc can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation sets this register to 80h. figure 6-5. format of main osc control register (moc) address: ffa2h after reset: 80h r/w symbol <7> 6 5 4 3 2 1 0 moc mstop 0 0 0 0 0 0 0 control of high-speed system clock operation mstop x1 oscillation mode external clock input mode 0 x1 oscillator operating exter nal clock from exclk pin is enabled 1 x1 oscillator stopped external clock from exclk pin is disabled cautions 1. when setting mstop to 1, be su re to confirm that the cpu operates with a clock other than the high-speed system clock. specifically, set mstop to 1 under either of the following conditions. ? when mcs = 0 (when cpu operates with the internal high-speed oscillation clock) ? when cls = 1 (when cpu operates with the subsystem clock) in addition, stop peripheral hardware th at is operating on the high-speed system clock before setting mstop to 1. 2. do not clear mstop to 0 while bit 6 (oscsel) of the clock operation mode select register (oscctl) is 0. 3. the peripheral hardware cannot operate when the peripheral hardware clock is stopped. to resume the operation of the peripheral hardware after the peripheral hardware clock has been stopped, initialize the peripheral hardware.
chapter 6 clock generator user?s manual u19180ej1v0ud 190 (5) clock operation mode select register (oscctl) this register selects the operation modes of the high-speed system and subsystem clocks. oscctl can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears this register to 00h. figure 6-6. format of clock operati on mode select register (oscctl) address: ffefh after reset: 00h r/w symbol <7> <6> <5> <4> 3 2 1 <0> oscctl exclk oscsel exclks oscsels 0 0 0 amph exclk oscsel high-speed system clock operation mode p121/x1 pin p122/x2/exclk pin 0 0 i/o port mode i/o port 0 1 x1 oscillation mode crystal/ceramic resonator connection 1 0 i/o port mode i/o port 1 1 external clock input mode i/o port external clock input exclks oscsels subsystem clock operation mode p123/xt1 pin p124/xt2/exclks pin 0 0 i/o port mode i/o port 0 1 xt1 oscillation mode cr ystal resonator connection 1 0 i/o port mode i/o port 1 1 external clock input mode i/o port external clock input amph operating frequency control 0 4 mhz f xh 10 mhz 1 10 mhz < f xh 20 mhz cautions 1. be sure to se t amph to 1 if the high-speed syst em clock oscillation frequency exceeds 10 mhz. 2. set amph before setting the main clock mode register (mcm). 3. set amph before setting the periphera l functions after a reset release. the value of amph can be changed only once after a reset release. when the high- speed system clo ck (x1 oscillation) is selected as the cpu clock, supply of the cpu clock is stopped for 4.06 to 16.12 s after amph is set to 1. when the high- speed system clock (external clock input) is selected as the cpu clock, supply of the cpu clock is stopped for the durati on of 160 external clocks after amph is set to 1. 4. if the stop instruction is executed wh en amph = 1, supply of the cpu clock is stopped for 4.06 to 16.12 s after the stop mode is released when the internal high-speed oscillation clock is selected as the cp u clock, or for the duration of 160 external clocks when the high-speed sy stem clock (external clock input) is selected as the cpu cl ock. when the high-speed sy stem clock (x1 oscillation) is selected as the cpu clock, the oscillation stabilization time is counted after the stop mode is released. 5. amph can be changed only once after a reset release.
chapter 6 clock generator user?s manual u19180ej1v0ud 191 cautions 6. to change the value of exclk and oscsel, be sure to confirm that bit 7 (mstop) of the main osc control register (moc) is 1 (the x1 oscillator stops or the external clock from the exclk pin is disabled). 7. to change the value of exclks and oscsels, confirm that bit 5 (cls) of the processor clock control register (pcc) is 0 (the cpu is operating with the high- speed system clock). remark f xh : high-speed system clock oscillation frequency
chapter 6 clock generator user?s manual u19180ej1v0ud 192 (6) oscillation stabilization time counter status register (ostc) this is the status register of t he x1 clock oscillation stabilization time counter. if the internal high-speed oscillation clock or subsystem clock is used as the cpu cl ock, the x1 clock oscillatio n stabilization time can be checked. ostc can be read by a 1-bit or 8-bit memory manipulation instruction. when reset is released (reset by reset input, poc, lv i, and wdt), the stop instruction and mstop (bit 7 of moc register) = 1 clear ostc to 00h. figure 6-7. format of oscillation stabilization time counter status register (ostc) address: ffa3h after reset: 00h r symbol 7 6 5 4 3 2 1 0 ostc 0 0 0 most11 most 13 most14 most15 most16 most11 most13 most14 most15 most16 oscillation stabilization time status f x = 10 mhz f x = 20 mhz 1 0 0 0 0 2 11 /f x min. 204.8 s min. 102.4 s min. 1 1 0 0 0 2 13 /f x min. 819.2 s min. 409.6 s min. 1 1 1 0 0 2 14 /f x min. 1.64 ms min. 819.2 s min. 1 1 1 1 0 2 15 /f x min. 3.27 ms min. 1.64 ms min. 1 1 1 1 1 2 16 /f x min. 6.55 ms min. 3.27 ms min. cautions 1. after the above time has elapsed, the bits are set to 1 in order from most11 and remain 1. 2. if the stop mode is entered and th en released while the internal high-speed oscillation clock or subsystem clock is being used as the cpu clock, set the oscillation stabilization time as follows. ? desired ostc oscillation stabilization time oscillation stabilization time set by osts the oscillation stabilization time counter counts up to the oscillation stabilization time set by osts. note, therefore, that only the status up to the oscillation stabilization time set by osts is set to ostc after stop mode is released. 3. the x1 clock oscillation stabilization wa it time does not include the time until clock oscillation starts (?a? below). stop mode release x1 pin voltage waveform a remark f x : x1 clock oscillation frequency
chapter 6 clock generator user?s manual u19180ej1v0ud 193 (7) oscillation stabilization time select register (osts) this register is used to select the x1 clock oscillati on stabilization wait time when the stop mode is released. the wait time set by osts is valid only after the stop mode is released with the x1 clock selected as the cpu clock. after the stop mode is released with the in ternal high-speed oscillation clock or subsystem clock selected as the cpu clock, t he oscillation stabilization time must be confirmed by ostc. osts can be set by an 8-bit memo ry manipulation instruction. reset signal generation sets osts to 05h. figure 6-8. format of oscillation stabiliz ation time select register (osts) address: ffa4h after reset: 05h r/w symbol 7 6 5 4 3 2 1 0 osts 0 0 0 0 0 osts2 osts1 osts0 osts2 osts1 osts0 oscillation stabilization time selection f x = 10 mhz f x = 20 mhz 0 0 1 2 11 /f x 204.8 s 102.4 s 0 1 0 2 13 /f x 819.2 s 409.6 s 0 1 1 2 14 /f x 1.64 ms 819.2 s 1 0 0 2 15 /f x 3.27 ms 1.64 ms 1 0 1 2 16 /f x 6.55 ms 3.27 ms other than above setting prohibited cautions 1. to set the stop mode when the x1 clock is used as the cpu clock, set osts before executing the stop instruction. 2. do not change the value of the osts register during the x1 clock oscillation stabilization time. 3. if the stop mode is entered and th en released while the internal high-speed oscillation clock or subsystem clock is being used as the cpu clock, set the oscillation stabilization time as follows. ? desired ostc oscillation stabilization time oscillation stabilization time set by osts the oscillation stabilization time counter counts up to the oscillation stabilization time set by osts. note, therefore, that only the status up to the oscillation stabilization time set by osts is set to ostc after stop mode is released. 4. the x1 clock oscillation stabilization wa it time does not include the time until clock oscillation starts (?a? below). stop mode release x1 pin voltage waveform a remark f x : x1 clock oscillation frequency
chapter 6 clock generator user?s manual u19180ej1v0ud 194 6.4 system clock oscillator 6.4.1 x1 oscillator the x1 oscillator oscillates with a cr ystal resonator or ceramic resonator (4 to 20 mhz) connected to the x1 and x2 pins. an external clock can also be input. in this case, input the clock signal to the exclk pin. figure 6-9 shows an example of the exte rnal circuit of the x1 oscillator. figure 6-9. example of extern al circuit of x1 oscillator (a) crystal or ceramic osc illation (b) external clock v ss x1 x2 crystal resonator or ceramic resonator exclk external clock cautions are listed on the next page. 6.4.2 xt1 oscillator the xt1 oscillator oscillates with a crystal resonator (s tandard: 32.768 khz) connect ed to the xt1 and xt2 pins. an external clock can also be input. in this case, input the clock signal to the exclks pin. figure 6-10 shows an example of the exte rnal circuit of the xt1 oscillator. figure 6-10. example of external circuit of xt1 oscillator (a) crystal oscillation (b) external clock xt2 v ss xt1 32.768 khz exclks external clock cautions are listed on the next page.
chapter 6 clock generator user?s manual u19180ej1v0ud 195 caution when using the x1 oscillator and xt1 oscilla tor, wire as follows in the area enclosed by the broken lines in the figures 6-9 and 6-10 to avoid an adverse effect from wiring capacitance. ? keep the wiring length as short as possible. ? do not cross the wiring with the other signal lines. do not route the wiring near a signal line through which a high fluctuating current flows. ? always make the ground point of the os cillator capacitor the same potential as v ss . do not ground the capacitor to a ground pattern through which a high current flows. ? do not fetch signals from the oscillator. note that the xt1 oscillator is designed as a low-amplitude circuit for reducing power consumption. figure 6-11 shows examples of incorrect resonator connection. figure 6-11. examples of incorrect resonator connection (1/2) (a) too long wiring (b) crossed signal line x2 v ss x1 x1 v ss x2 port remark when using the subsystem clock, replace x1 and x2 with xt1 and xt2, respectively. also, insert resistors in series on the xt2 side.
chapter 6 clock generator user?s manual u19180ej1v0ud 196 figure 6-11. examples of incorrect resonator connection (2/2) (c) wiring near high alternating current (d) current flowing through ground line of oscillator (potential at points a, b, and c fluctuates) v ss x1 x2 v ss x1 x2 ab c pmn v dd high current high current (e) signals are fetched v ss x1 x2 remark when using the subsystem clock, replace x1 and x2 with xt1 and xt2, respectively. also, insert resistors in series on the xt2 side. caution when x2 and xt1 are wired in parallel, the crosstalk noise of x2 may increase with xt1, resulting in malfunctioning.
chapter 6 clock generator user?s manual u19180ej1v0ud 197 6.4.3 when subsystem clock is not used if it is not necessary to use the subsystem clock for low power consumption operations, or if not using the subsystem clock as an i/o port, set the xt1 and xt2 pins to i/o mode (oscsels = 0) and connect them as follows. input (pm123/pm124 = 1): i ndependently connect to v dd or v ss via a resistor. output (pm123/pm124 = 0): leave open. remark oscsels: bit 4 of clock operati on mode select register (oscctl) pm123, pm124: bits 3 and 4 of port mode register 12 (pm12) 6.4.4 internal hi gh-speed oscillator the internal high-speed oscillator is in corporated in the 78k0/fx2 microcontro llers. oscillation can be controlled by the internal oscillator mode register (rcm). after a reset release, the internal high-speed oscillation clock starts oscillation (8 mhz (typ.)). 6.4.5 internal low-speed oscillator the internal low-speed oscillator is incorporated in the 78k0/fx2 microcontrollers. the internal low-speed oscillation clock is only used as the watchdog timer and the clock of 8-bit timer h1. the internal low-speed oscillation clock cannot be used as the cpu clock. ?can be stopped by software? or ?cannot be stopped? can be selected by the option byte. when ?can be stopped by software? is set, oscillation can be controlled by the internal oscillator mode register (rcm). after a reset release, the internal low-speed oscillat ion clock starts oscillation and the watchdog timer is operated (240 khz (typ.)). 6.4.6 prescaler the prescaler generates various clocks by dividing the main system clock when the main system clock is selected as the clock to be supplied to the cpu.
chapter 6 clock generator user?s manual u19180ej1v0ud 198 6.5 clock generator operation the clock generator generates the following clocks and cont rols the operation modes of the cpu, such as standby mode. ? main system clock f xp ? high-speed system clock f xh x1 clock f x external main system clock f exclk ? internal high-speed oscillation clock f rh ? subsystem clock f sub ? xt1 clock f xt ? external subsystem clock f exclks ? internal low-speed oscillation clock f rl ? cpu clock f cpu ? peripheral hardware clock f prs the cpu starts operation when the on-chip internal high-s peed oscillator starts outputting after a reset release in the 78k0/fx2 microcontrollers, thus enabling the following. (1) enhancement of security function when the x1 clock is set as the cpu clock by the defaul t setting, the device cannot operate if the x1 clock is damaged or badly connected and therefore does not operate after reset is re leased. however, the start clock of the cpu is the on-chip internal high -speed oscillation clock, so the devic e can be started by the internal high- speed oscillation clock after a reset release. conseque ntly, the system can be safely shut down by performing a minimum operation, such as acknowledging a reset source by software or performing safety processing when there is a malfunction. (2) improvement of performance because the cpu can be started without waiting for t he x1 clock oscillation stabilization time, the total performance can be improved. a timing diagram of the cpu default start using the inter nal high-speed oscillation clock is shown in figure 6-12 and 6-13.
chapter 6 clock generator user?s manual u19180ej1v0ud 199 figure 6-12 operation of the clock generating circuit when power supply voltage injection (when 1.59 v poc mode setup (option byte: lvistart = 0)) internal high-speed oscillation clock (f rh ) cpu clock high-speed system clock (f xh ) (when x1 oscillation selected) internal high-speed oscillation clock high-speed system clock switched by software subsystem clock (f sub ) (when xt1 oscillation selected) subsystem clock x1 clock oscillation stabilization time: 2 11 /f x to 2 16 /f x note 2 starting x1 oscillation is set by software. starting xt1 oscillation is set by software. reset processing (11 to 45 s) <3> waiting for voltage stabilization internal reset signal 0 v 1.59 v (typ.) 1.8 v 0.5 v/ms (min. notes 1, 2 ) power supply voltage (v dd ) <1> <2> <4> <5> <5> <4> note 1 (1.93 to 5.39 ms) <1> the internal reset signal by the power-on clear (poc) circuit is generated after a power supply injection. <2> if power supply voltage exceeds 1.59 v (typ.), reset will be released an d the oscillation start of the high- speed oscillator will be carried out automatically. <3> if power supply voltage is rose by in clination of 0.5 v/ms (mi n.), after the voltage st able waiting time of a power supply/regulator passed after reset release and re set processing will be performed, cpu carries out a start of operation with hi gh-speed oscillation clock. <4> one clock or xt1 clock should set up an oscillation start by software (see (1) in 6.6.1 controlling high- speed system clock and (1) in 6.6.3 example of controlling subsystem clock ). <5> when you change cpu to x1 clock or xt1 clock, set up a change by software after the oscillation stability waiting of a clock (see (3) in 6.6.1 controlling high-speed system clock and (3) in 6.6.3 example of controlling subsystem clock ). notes 1. with (a) grade products, if the voltage rises with a slope of less than 0.5 v/ms (min.) from power application until the voltage reaches 1.8 v, input a low level to t he reset pin from power application until the voltage reaches 1.8 v, or set the 2.7 v/1.59 v poc mode by using the option byte (pocmode = 1) (see figure 6-13 ). when a low level has been input to the reset pin until the voltage reaches 1.8 v, the cpu oper ates with the same timing as <2> and thereafter in figure 6-15, after the reset has been released by the reset pin. 2. with (a2) grade products, if the voltage rises with a slope of less than 0.75 v/ms (min.) from power application until the voltage reaches 2.7 v, input a low level to t he reset pin from power application until the voltage reaches 2. 7 v. when a low level has been input to the reset pin until the voltage reaches 2.7 v, the cpu operates with the same timi ng as <2> and thereafter in figure 6-15, after the reset has been released by the reset pin.
chapter 6 clock generator user?s manual u19180ej1v0ud 200 notes 3. the internal voltage stabilization time includes the o scillation accuracy stabilization time of the internal high-speed oscillation clock. 4. when releasing a reset (above figure) or releas ing stop mode while the cpu is operating on the internal high-speed oscillation clock, confirm the osci llation stabilization time for the x1 clock using the oscillation stabilization time count er status register (ostc). if the cpu operates on the high-speed system clock (x1 oscillation), set the oscillation stabilization time when releasing stop mode using the oscillation stabilization time select register (osts).
chapter 6 clock generator user?s manual u19180ej1v0ud 201 cautions 1. when the standup of voltage until it reach es 1.8 v from the time of a power supply injection is looser than 0.5 v/ms (min.), in put a low level into reset pin, or set up 2.7 v/1.59 v poc mode (lvistart = 1) from an option byte until it reaches 1.8 v from the time of a power supply injection (refer to figure 6-13). when a low le vel is inputted into reset pin until it reaches 1.8 v, after the reset release by reset pin operates to the same timing as <2> of figure 6-12 or subsequent ones. 2. when using the external clock input from exclk pin and exclks pin, oscillation stable waiting time is unnecessary. remark the clock which is not used as a cpu clock can be suspended by setup of software during microcomputer operation. moreover, high-speed osci llation clock and a high-speed system clock can suspend a clock by execution of a stop command (see (4) in 6.6.1 controlling high-speed system clock , (3) in 6.6.2 example of controlling inte rnal high-speed oscillation clock , and (4) in 6.6.3 example of controlling subsystem clock ).
chapter 6 clock generator user?s manual u19180ej1v0ud 202 figure 6-13 operation of the clock generating circuit when power supply voltage injection (when 2.7 v/1.59v poc mode setup (option byte: lvistart = 1)) internal high-speed oscillation clock (f rh ) cpu clock high-speed system clock (f xh ) (when x1 oscillation selected) internal high-speed oscillation clock high-speed system clock switched by software subsystem clock (f sub ) (when xt1 oscillation selected) subsystem clock x1 clock oscillation stabilization time: 2 11 /f x to 2 16 /f x note starting x1 oscillation is set by software. starting xt1 oscillation is set by software. waiting for oscillation accuracy stabilization (86 to 361 s) internal reset signal 0 v 2.7 v (typ.) power supply voltage (v dd ) <1> <3> <2> <4> <5> reset processing (11 to 45 s) <4> <5> <1> the internal reset signal by the power-on clear (poc) circuit is generated after a power supply injection. <2> if power supply voltage exceeds 1.59 v (typ.), reset will be canceled and the osc illation start of the high- speed oscillator will be carried out automatically. <3> after reset release, after reset processing is performe d, cpu carries out a start of operation with high-speed oscillation clock. <4> x1 clock or xt1 clock should set up an oscillation start by software (see (1) in 6.6.1 controlling high- speed system clock and (1) in 6.6.3 example of controlling subsystem clock ). <5> when you change cpu to x1 clock or xt1 clock, set up a change by software after the oscillation stability waiting of a clock (see (3) in 6.6.1 controlling high-speed system clock and (3) in 6.6.3 example of controlling subsystem clock ). note check the oscillation stable time of x1 clock with an oscillation stable time counter status register (ostc) when stop mode release in case the time of rese t release (figure 6-13) and a cpu clock are high-speed oscillation clocks . moreover, when a cpu clock is a high-speed system clock (x1 oscillation), set up the oscillation stable time at the time of stop mode rel ease by the oscillation stable time selection register (osts). cautions 1. a voltage oscillation st abilization time of 1.93 to 5.39 ms is required after the supply voltage reaches 1.59 v (typ.). if the supply voltage rises from 1.59 v (typ.) to 2.7 v (typ.) within 1.93 ms, the power supply oscillation stabilizatio n time of 0 to 5.39 ms is automatically generated before reset processing. 2. it is not necessa ry to wait for the oscillation stabilizat ion time when an external clock input from the exclk and exclks pins is used.
chapter 6 clock generator user?s manual u19180ej1v0ud 203 remark the clock which is not used as a cpu clock can be suspended by setup of software during microcomputer operation. moreover, high-speed osc illation clock and a high-speed system clock can suspend a clock by execution of a stop command (see (4) in 6.6.1 controlling high-speed system clock, (3) in 6.6.2 example of controlling inte rnal high-speed oscillation clock , and (4) in 6.6.3 example of controlling subsystem clock ). 6.6 controlling clock 6.6.1 controlling high-speed system clock the following two types of high-speed system clocks are available. ? x1 clock: crystal/ceramic resonator is connected across the x1 and x2 pins. ? external main system cl ock: external clock is input to the exclk pin. when the high-speed system clock is not used, the x1/p121 and x2/exclk/p 122 pins can be used as i/o port pins. caution the x1/p121 and x2/exclk/p122 pins are in the i/o port mode after a reset release. the following describes examples of setting procedures for the following cases. (1) when oscillating x1 clock (2) when using external main system clock (3) when using high-speed system clock as cpu clock and peripheral hardware clock (4) when stopping high-speed system clock (1) example of setting procedure when oscillating the x1 clock <1> setting frequency (oscctl register) using amph, set the gain of the on-chip osci llator according to the frequency to be used. amph note operating frequency control 0 4 mhz f xh 10 mhz 1 10 mhz < f xh 20 mhz note set amph before setting the peripheral functions a fter a reset release. the value of amph can be changed only once after a reset release. when amph is set to 1, the clock supply to the cpu is stopped for 4.06 to 16.12 s. remark f xh : high-speed system clock oscillation frequency <2> setting p121/x1 and p122/x2/exclk pins and selecting x1 clock or external clock (oscctl register) when exclk is cleared to 0 and oscsel is set to 1, the mode is switched from port mode to x1 oscillation mode. exclk oscsel operation mode of high- speed system clock pin p121/x1 pin p122/x2/exclk pin 0 1 x1 oscillation mode crystal/ceramic resonator connection <3> controlling oscillation of x1 clock (moc register) if mstop is cleared to 0, the x1 oscillator starts oscillating.
chapter 6 clock generator user?s manual u19180ej1v0ud 204 <4> waiting for the stabilization of the oscillation of x1 clock check the ostc register and wait for the necessary time. during the wait time, other software processing can be executed with the internal high-speed oscillation clock. cautions 1. do not change the value of exclk and oscsel while the x1 clock is operating. 2. set the x1 clock after th e supply voltage has reached the ope rable voltage of the clock to be used (see chapter 27 electrical specifications ((a) grade products) or chapter 28 electrical specifications ((a2) grade products)). (2) example of setting procedure when using the external main system clock <1> setting frequency (oscctl register) using amph, set the frequency to be used. amph note operating frequency control 0 4 mhz f xh 10 mhz 1 10 mhz < f xh 20 mhz note set amph before setting the peripheral functions a fter a reset release. the value of amph can be changed only once after a reset release. the clock supply to the cpu is stopped for the duration of 160 external clocks after amph is set to 1. remark f xh : high-speed system clock oscillation frequency <2> setting p121/x1 and p122/x2/exclk pins and selecting operation mode (oscctl register) when exclk and oscsel are set to 1, the mode is switched from port mode to external clock input mode. exclk oscsel operation mode of high- speed system clock pin p121/x1 pin p122/x2/exclk pin 1 1 external clock input mode i/o port external clock input <3> controlling external main system clock input (moc register) when mstop is cleared to 0, the input of t he external main system clock is enabled. cautions 1. do not change the value of exclk and oscsel while the external main system clock is operating. 2. set the external main system clock after the supply vo ltage has reached the operable voltage of the clock to be used (see chapter 27 electrical specifications ((a) grade products) or chapter 28 electrical specifications ((a2) grade products)). (3) example of setting procedure when using high-speed system clock as cpu clock and peripheral hardware clock <1> setting high-speed system clock oscillation note (see 6.6.1 (1) example of setting proce dure when oscillating the x1 clock and (2) example of setting procedure when using the external main system clock. ) note the setting of <1> is not necessary when hi gh-speed system clock is already operating.
chapter 6 clock generator user?s manual u19180ej1v0ud 205 <2> setting the high-speed system clock as the main system clock (mcm register) when xsel and mcm0 are set to 1, the high-speed syst em clock is supplied as the main system clock and peripheral hardware clock. selection of main system clock and clock supplied to peripheral hardware xsel mcm0 main system clock (f xp ) peripheral hardware clock (f prs ) 1 1 high-speed system clock (f xh ) high-speed system clock (f xh ) caution if the high-speed system clock is selected as the main system clock, a clock other than the high-speed system clock cannot be set as the peripheral hardware clock. <3> setting the main system clock as the cpu cl ock and selecting the division ratio (pcc register) when css is cleared to 0, the main system clock is supplied to the cpu. to select the cpu clock division ratio, use pcc0, pcc1, and pcc2. css pcc2 pcc1 pcc0 cpu clock (f cpu ) selection 0 0 0 f xp 0 0 1 f xp /2 (default) 0 1 0 f xp /2 2 0 1 1 f xp /2 3 1 0 0 f xp /2 4 0 other than above setting prohibited (4) example of setting procedure when stopping the high-speed system clock the high-speed system clock can be stopped in the following two ways. ? executing the stop instruction and stopping the x1 oscillation (disabling clock input if the external clock is used) ? setting mstop to 1 and stopping the x1 oscillation (dis abling clock input if the external clock is used) (a) to execute a stop instruction <1> setting to stop peripheral hardware stop peripheral hardware that cannot be used in the stop mode (for peripheral hardware that cannot be used in stop mode, see chapter 18 standby function ). <2> setting the x1 clock oscillation stabi lization time afte r standby release when the cpu is operating on the x1 clock, set the value of the osts register before the stop instruction is executed. <3> executing the stop instruction when the stop instruction is exec uted, the system is placed in the stop mode and x1 oscillation is stopped (the input of the ex ternal clock is disabled).
chapter 6 clock generator user?s manual u19180ej1v0ud 206 (b) to stop x1 oscillation (disabling external clock input) by setting mstop to 1 <1> confirming the cpu clock status (pcc and mcm registers) confirm with cls and mcs that the cpu is operat ing on a clock other than the high-speed system clock. when cls = 0 and mcs = 1, the high-speed system clock is supplied to the cpu, so change the cpu clock to the subsystem clock or internal high-speed oscillation clock. cls mcs cpu clock status 0 0 internal high-speed oscillation clock 0 1 high-speed system clock 1 subsystem clock <2> stopping the high-speed system clock (moc register) when mstop is set to 1, x1 oscillation is stopped (the input of the external clock is disabled). caution be sure to confirm that mcs = 0 or cls = 1 when setting mstop to 1. in addition, stop peripheral hardware that is operating on the high-speed system clock. 6.6.2 example of controlling inte rnal high-speed oscillation clock the following describes examples of clock setting procedures for the following cases. (1) when restarting oscillation of the internal high-speed oscillation clock (2) when using internal high-speed oscillation clock as cpu clock, and internal high-speed oscillation clock or high-speed system clock as peripheral hardware clock (3) when stopping the internal high-speed oscillation clock (1) example of setting procedure wh en restarting oscillation of the in ternal high-speed oscillation clock note 1 <1> setting restart of oscillation of the inte rnal high-speed oscillation clock (rcm register) when rstop is cleared to 0, the internal hi gh-speed oscillation clock starts operating. <2> waiting for the oscillation accuracy stabilization time of internal high-speed oscillation clock (rcm register) wait until rsts is set to 1 note 2 . notes 1. after a reset release, the internal high-speed oscillator automatically starts oscillating and the internal high-speed oscillation clock is selected as the cpu clock. 2. this wait time is not necessary if high accura cy is not necessary for the cpu clock and peripheral hardware clock. (2) example of setting procedure when using intern al high-speed oscillation clock as cpu clock, and internal high-speed oscillation clock or high-speed system clo ck as peripheral hardware clock <1> ? restarting oscillation of the internal high-speed oscillation clock note (see 6.6.2 (1) example of setting procedure when restarting internal high-speed oscillation clock ). ? oscillating the high-speed system clock note (this setting is required when using the high-speed system clock as the peripheral hardware clock. see 6.6.1 (1) example of setting proced ure when oscillating the x1 clock and (2) example of setting procedure when using the external main system clock. )
chapter 6 clock generator user?s manual u19180ej1v0ud 207 note the setting of <1> is not necessary when the internal high-speed oscillation clock or high- speed system clock is already operating. <2> selecting the clock supplied as the main system clock and peripheral hardware clock (mcm register) set the main system clock and peripheral hardware clock using xsel and mcm0. selection of main system clock and clock supplied to peripheral hardware xsel mcm0 main system clock (f xp ) peripheral hardware clock (f prs ) 0 0 0 1 internal high-speed oscillation clock (f rh ) 1 0 internal high-speed oscillation clock (f rh ) high-speed system clock (f xh ) <3> selecting the cpu clock division ratio (pcc register) when css is cleared to 0, the main system clock is supplied to the cpu. to select the cpu clock division ratio, use pcc0, pcc1, and pcc2. css pcc2 pcc1 pcc0 cpu clock (f cpu ) selection 0 0 0 f xp 0 0 1 f xp /2 (default) 0 1 0 f xp /2 2 0 1 1 f xp /2 3 1 0 0 f xp /2 4 0 other than above setting prohibited (3) example of setting procedure when stoppi ng the internal high-speed oscillation clock the internal high-speed oscillation clock can be stopped in the following two ways. ? executing the stop instruction to set the stop mode ? setting rstop to 1 and stopping the internal high-speed oscillation clock (a) to execute a stop instruction <1> setting of peripheral hardware stop peripheral hardware that cannot be used in the stop mode (for peripheral hardware that cannot be used in stop mode, see chapter 18 standby function ). <2> setting the x1 clock oscillation stabi lization time afte r standby release when the cpu is operating on the x1 clock, set the value of the osts register before the stop instruction is executed. <3> executing the stop instruction when the stop instruction is exec uted, the system is placed in the stop mode and internal high- speed oscillation clock is stopped.
chapter 6 clock generator user?s manual u19180ej1v0ud 208 (b) to stop internal high-speed o scillation clock by setting rstop to 1 <1> confirming the cpu clock status (pcc and mcm registers) confirm with cls and mcs that the cpu is operating on a clock other than the internal high-speed oscillation clock. when cls = 0 and mcs = 0, the internal high-speed oscillation clock is supplied to the cpu, so change the cpu clock to the high-speed system clock or subsystem clock. cls mcs cpu clock status 0 0 internal high-speed oscillation clock 0 1 high-speed system clock 1 subsystem clock <2> stopping the internal high-speed oscillation clock (rcm register) when rstop is set to 1, internal high-speed oscillation clock is stopped. caution be sure to confirm that mcs = 1 or cls = 1 when setting rstop to 1. in addition, stop peripheral hardware that is operating on the internal hi gh-speed oscillation clock. 6.6.3 example of controlling subsystem clock the following two types of subsystem clocks are available. ? xt1 clock: crystal/ceramic resonator is connected across the xt1 and xt2 pins. ? external subsystem clock: external clock is input to the exclks pin. when the subsystem clock is not us ed, the xt1/p123 and xt2/exclks/p124 pi ns can be used as i/o port pins. caution the xt1/p123 and xt2/exclks/p124 pins are in the i/o port mode after a reset release. the following describes examples of setting procedures for the following cases. (1) when oscillating xt1 clock (2) when using external subsystem clock (3) when using subsystem clock as cpu clock (4) when stopping subsystem clock (1) example of setting procedur e when oscillating the xt1 clock <1> setting xt1 and xt2 pins and selecting op eration mode (pcc and oscctl registers) when xtstart, exclks, and oscsels are set as any of the following, the m ode is switched from port mode to xt1 oscillation mode. xtstart exclks oscsels operation mode of subsystem clock pin p123/xt1 pin p124/xt2/ exclks pin 0 0 1 1 xt1 oscillation mode crystal/ceramic resonator connection remark : don?t care <2> waiting for the stabilization of the subsystem clock oscillation wait for the oscillation stabilization time of the s ubsystem clock by software, using a timer function. caution do not change the value of xtstart, exclks, and oscsels while the subsystem clock is operating.
chapter 6 clock generator user?s manual u19180ej1v0ud 209 (2) example of setting procedure when using the external subsystem clock <1> setting xt1 and xt2 pins, selecting xt1 clock/external clock and controlling oscillation (pcc and oscctl registers) when xtstart is cleared to 0 and exclks and oscsels are set to 1, the mode is switched from port mode to external clock input mode. in this ca se, input the external clo ck to the exclks/xt2/p124 pins. xtstart exclks oscsels operation mode of subsystem clock pin p123/xt1 pin p124/xt2/ exclks pin 0 1 1 external clock input mode i/o port external clock input caution do not change the value of xtstart, exclks, and oscsels while the subsystem clock is operating. (3) example of setting procedure when using the subsystem clock as the cpu clock <1> setting subsystem clock oscillation note (see 6.6.3 (1) example of setting proce dure when oscillating the xt1 clock and (2) example of setting procedure when using the external subsystem clock .) note the setting of <1> is not necessary when while the subsystem clock is operating. <2> switching the cpu clock (pcc register) when css is set to 1, the subsystem clock is supplied to the cpu. css pcc2 pcc1 pcc0 cpu clock (f cpu ) selection 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 f sub /2 1 other than above setting prohibited (4) example of setting procedure when stopping the subsystem clock <1> confirming the cpu clock status (pcc and mcm registers) confirm with cls and mcs that the cpu is operat ing on a clock other than the subsystem clock. when cls = 1, the subsystem clock is supplied to t he cpu, so change the cpu clock to the internal high-speed oscillation clock or high-speed system clock. cls mcs cpu clock status 0 0 internal high-speed oscillation clock 0 1 high-speed system clock 1 subsystem clock <2> stopping the subsystem clock (oscctl register) when oscsels is cleared to 0, xt1 oscillation is stop ped (the input of the external clock is disabled). cautions 1. be sure to confirm that cls = 0 when clearing oscsels to 0. in addition, stop the watch timer if it is operating on the subsystem clock. 2. the subsystem clock oscillation cannot be stopped using the stop instruction.
chapter 6 clock generator user?s manual u19180ej1v0ud 210 6.6.4 controlling internal low-speed oscillation clock the internal low-speed oscillation clock is a clock for the watchdog timer. it cannot be used as the cpu clock. with this clock, only the following peripheral hardware can operate. ? watchdog timer ? 8-bit timer h1 (if f rl is selected as the count clock) in addition, the following operation modes can be selected by the option byte. ? internal low-speed oscillation clock oscillation cannot be stopped ? internal low-speed oscillation clock oscillation can be stopped by software the internal low-speed oscillator autom atically starts oscillation after a reset release, and the watchdog timer is driven (240 khz (typ.)) if the watchdog timer operation has been enabled by the option byte. (1) to stop the internal low-speed oscillation clock (example of setting method) <1> setting lsrstop to 1 (rcm register) if lsrstop is set to 1, the internal low-speed oscillator oscillation is stopped. (2) to oscillate the internal low-speed oscillation clock (example of setting method) <1> clearing lsrstop to 0 (rcm register) if lsrstop is cleared to 0, the internal lo w-speed oscillation clock is oscillated. caution if ?internal low-speed oscillation clock oscillation cannot be stopped? is selected by the option byte, oscillation of the internal low-speed oscillation clock cannot be controlled. 6.6.5 clocks supplied to cp u and peripheral hardware the following table shows the relation among the clocks supplied to the cpu and peripheral hardware, and setting of registers. table 6-3. clocks supplied to cpu and peripheral hardware, and register setting supplied clock xsel css mcm0 exclk clock supplied to cpu clock supplied to peripheral hardware 0 0 internal high-speed oscillation clock 0 1 subsystem clock internal high-speed oscillation clock 1 0 0 0 x1 clock 1 0 0 1 internal high-speed oscillation clock external main system clock 1 0 1 0 x1 clock 1 0 1 1 external main system clock 1 1 0 0 x1 clock 1 1 0 1 external main system clock 1 1 1 0 x1 clock 1 1 1 1 subsystem clock external main system clock remarks 1. xsel: bit 2 of the main clock mode register (mcm) 2. css: bit 4 of the processor clock control register (pcc) 3. mcm0: bit 0 of mcm 4. exclk: bit 7 of the clock operat ion mode select register (oscctl)
chapter 6 clock generator user?s manual u19180ej1v0ud 211 6.6.6 cpu clock stat us transition diagram figure 6-14 shows the cpu clock status transition diagram of this product. figure 6-14. cpu clock st atus transition diagram (when 1.59 v poc mode is set (option byte: lvistart = 0)) power on reset release v dd 1.59 v (typ.) v dd 1.8 v (min.) v dd < 1.59 v (typ.) internal low-speed oscillation: woken up internal high-speed oscillation: woken up x1 oscillation/exclk input: stops (i/o port mode) xt1 oscillation/exclks input: stops (i/o port mode) internal low-speed oscillation: operating internal high-speed oscillation: operating x1 oscillation/exclk input: stops (i/o port mode) xt1 oscillation/exclks input: stops (i/o port mode) cpu: operating with internal high- speed oscillation internal low-speed oscillation: operable internal high-speed oscillation: operating x1 oscillation/exclk input: selectable by cpu xt1 oscillation/exclks input: selectable by cpu cpu: internal high- speed oscillation stop internal low-speed oscillation: operable internal high-speed oscillation: stops x1 oscillation/exclk input: stops xt1 oscillation/exclks input: operable cpu: internal high- speed oscillation halt internal low-speed oscillation: operable internal high-speed oscillation: operating x1 oscillation/exclk input: operable xt1 oscillation/exclks input: operable cpu: operating with x1 oscillation or exclk input cpu: x1 oscillation/exclk input stop cpu: x1 oscillation/exclk input halt internal low-speed oscillation: operable internal high-speed oscillation: selectable by cpu x1 oscillation/exclk input: operating xt1 oscillation/exclks input: selectable by cpu internal low-speed oscillation: operable internal high-speed oscillation: stops x1 oscillation/exclk input: stops xt1 oscillation: operable internal low-speed oscillation: operable internal high-speed oscillation: operable x1 oscillation/exclk input: operating xt1 oscillation/exclks input: operable cpu: operating with xt1 oscillation or exclks input cpu: xt1 oscillation/exclks input halt internal low-speed oscillation: operable internal high-speed oscillation: selectable by cpu x1 oscillation/exclk input: selectable by cpu xt1 oscillation/exclks input: operating internal low-speed oscillation: operable internal high-speed oscillation: operable x1 oscillation/exclk input: operable xt1 oscillation/exclks input: operating (b) (a) (c) (d) (e) (f) (g) (h) (i) remark in the 2.7 v/1.59 v poc mode (opt ion byte: lvistart = 1), the cpu clock status changes to (a) in the above figure when the supply voltage exceeds 2.7 v (typ.), and to (b) after reset processing (11 to 45 s).
chapter 6 clock generator user?s manual u19180ej1v0ud 212 table 6-4 shows transition of the cpu clock and examples of setting the sfr registers. table 6-4. cpu clock transition and sfr register setting examples (1/4) (1) cpu operating with high-speed system clock (c) after reset release (a) (the cpu operates with the internal high-speed oscill ation clock immediately after a reset release (b).) (setting sequence of sfr registers) setting flag of sfr register status transition amph exclk oscsel mstop ostc register xsel mcm0 (a) (b) (c) (x1 clock: less than 10 mhz) 0 0 1 0 must be checked 1 1 (a) (b) (c) (external main clock: less than 10 mhz) 0 1 1 0 must not be checked 1 1 (a) (b) (c) (x1 clock: 10 mhz or more) 1 0 1 0 must be checked 1 1 (a) (b) (c) (external main clock: 10 mhz or more) 1 1 1 0 must not be checked 1 1 (2) cpu operating with internal high-speed oscillation clock (b) a fter reset release (a) status transition sfr register setting (a) (b) sfr registers do not have to be se t (default status after reset release). (3) cpu operating with subsystem clock (d) after reset release (a) (the cpu operates with the internal high-speed oscill ation clock immediately after a reset release (b).) (setting sequence of sfr registers) setting flag of sfr register status transition exclks oscsels waiting for oscillation stabilization css (a) (b) (d) (xt1 clock) 0 1 necessary 1 (a) (b) (d) (external subsystem clock) 1 1 unnecessary 1 remarks 1. (a) to (i) in table 6-4 correspond to (a) to (i) in figure 6-14. 2. exclk, oscsel, excl ks, oscsels, amph: bits 7 to 4 and 0 of the clock oper ation mode select register (oscctl) mstop: bit 7 of the main osc control register (moc) xsel, mcm0: bits 2 and 0 of the main clock mode register (mcm) css: bit 4 of the processor clock control register (pcc)
chapter 6 clock generator user?s manual u19180ej1v0ud 213 table 6-4. cpu clock transition and sfr register setting examples (2/4) (4) cpu clock changing from internal high-speed oscillation clock (b) to hi gh-speed system clock (c) (setting sequence of sfr registers) setting flag of sfr register status transition amph exclk oscsel mstop ostc register xsel mcm0 (b) (c) (x1 clock: less than 10 mhz) 0 0 1 0 must be checked 1 1 (b) (c) (external main clock: less than 10 mhz) 0 1 1 0 must not be checked 1 1 (b) (c) (x1 clock: 10 mhz or more) 1 0 1 0 must be checked 1 1 (b) (c) (external main clock: 10 mhz or more) 1 1 1 0 must not be checked 1 1 unnecessary if these registers are already set unnecessary if the cpu is operating with the high-speed system clock unnecessary if this register is already set (5) cpu clock changing from internal high-sp eed oscillation clock (b) to subsystem clock (d) (setting sequence of sfr registers) setting flag of sfr register status transition exclks oscsels waiting for oscillation stabilization css (b) (d) (xt1 clock) 0 1 necessary 1 (b) (d) (external subsystem clock) 1 1 unnecessary 1 unnecessary if the cpu is operating with the subsystem clock remarks 1. (a) to (i) in table 6-4 correspond to (a) to (i) in figure 6-14. 2. exclk, oscsel, excl ks, oscsels, amph: bits 7 to 4 and 0 of the clock oper ation mode select register (oscctl) mstop: bit 7 of the main osc control register (moc) xsel, mcm0: bits 2 and 0 of the main clock mode register (mcm) css: bit 4 of the processor clock control register (pcc)
chapter 6 clock generator user?s manual u19180ej1v0ud 214 table 6-4. cpu clock transition and sfr register setting examples (3/4) (6) cpu clock changing from high-speed system clo ck (c) to internal high-speed oscillation clock (b) (setting sequence of sfr registers) setting flag of sfr register status transition rstop rsts mcm0 (c) (b) 0 confirm this flag is 1. 0 unnecessary if the cpu is operating with the internal high-speed oscillation clock (7) cpu clock changing from high-speed system clock (c) to subsystem clock (d) (setting sequence of sfr registers) setting flag of sfr register status transition exclks oscsels waiting for oscillation stabilization css (c) (d) (xt1 clock) 0 1 necessary 1 (c) (d) (external subsystem clock) 1 1 unnecessary 1 unnecessary if the cpu is operating with the subsystem clock (8) cpu clock changing from subsystem clock (d) to high-speed system clock (c) (setting sequence of sfr registers) setting flag of sfr register status transition amph exclk oscsel mstop ostc register xsel mcm0 css (d) (c) (x1 clock: less than 10 mhz) 0 0 1 0 must be checked 1 1 0 (d) (c) (external main clock: less than 10 mhz) 0 1 1 0 must not be checked 1 1 0 (d) (c) (x1 clock: 10 mhz or more) 1 0 1 0 must be checked 1 1 0 (d) (c) (external main clock: 10 mhz or more) 1 1 1 0 must not be checked 1 1 0 unnecessary if these registers are already set unnecessary if the cpu is operating with the high-speed system clock unnecessary if this register is already set remarks 1. (a) to (i) in table 6-4 correspond to (a) to (i) in figure 6-14. 2. exclk, oscsel, excl ks, oscsels, amph: bits 7 to 4 and 0 of the clock oper ation mode select register (oscctl) mstop: bit 7 of the main osc control register (moc) xsel, mcm0: bits 2 and 0 of the main clock mode register (mcm) css: bit 4 of the processor clock control register (pcc) rsts, rstop: bits 7 and 0 of the internal oscillator mode register (rcm)
chapter 6 clock generator user?s manual u19180ej1v0ud 215 table 6-4. cpu clock transition and sfr register setting examples (4/4) (9) cpu clock changing from subsystem clock (d ) to internal high-speed oscillation clock (b) (setting sequence of sfr registers) setting flag of sfr register status transition rstop rsts mcm0 css (d) (b) 0 confirm this flag is 1. 0 0 unnecessary if the cpu is operating with the internal high-spee d oscillation clock unnecessary if xsel is 0 (10) ? halt mode (e) set while cpu is operating with internal hi gh-speed oscillation clock (b) ? halt mode (f) set while cpu is operating with high-speed system clock (c) ? halt mode (g) set while cpu is operating with subsystem clock (d) status transition setting (b) (e) (c) (f) (d) (g) executing halt instruction (11) ? stop mode (h) set while cpu is operating with internal hi gh-speed oscillation clock (b) ? stop mode (i) set while cpu is operating with high-speed system clock (c) (setting sequence) status transition setting (b) (h) (c) (i) stopping peripheral functions that cannot operate in stop mode executing stop instruction remarks 1. (a) to (i) in table 6-4 correspond to (a) to (i) in figure 6-14. 2. mcm0: bit 0 of the main clock mode register (mcm) css: bit 4 of the processor clock control register (pcc) rsts, rstop: bits 7 and 0 of the internal oscillator mode register (rcm)
chapter 6 clock generator user?s manual u19180ej1v0ud 216 6.6.7 condition before changing cpu clo ck and processing after changing cpu clock condition before changing the cpu clock and processing after changing the cpu clock are shown below. table 6-5. changing cpu clock cpu clock before change after change condition before change processing after change x1 clock stabilization of x1 oscillation ? mstop = 0, oscsel = 1, exclk = 0 ? after elapse of oscill ation stabilization time ? internal high-speed oscillator can be stopped (rstop = 1). ? clock supply to cpu is stopped for 4.06 to 16.12 s after amph has been set to 1. internal high- speed oscillation clock external main system clock enabling input of external clock from exclk pin ? mstop = 0, oscsel = 1, exclk = 1 ? internal high-speed oscillator can be stopped (rstop = 1). ? clock supply to cpu is stopped for the duration of 160 external clocks from the exclk pin after amph has been set to 1. x1 clock x1 oscillation can be stopped (mstop = 1). external main system clock internal high- speed oscillation clock oscillation of internal high-speed oscillator ? rstop = 0 external main system clock input can be disabled (mstop = 1). internal high- speed oscillation clock operating current can be reduced by stopping internal high-speed oscillator (rstop = 1). x1 clock x1 oscillation can be stopped (mstop = 1). external main system clock xt1 clock stabilization of xt1 oscillation ? xtstart = 0, exclks = 0, oscsels = 1, or xtstart = 1 ? after elapse of oscill ation stabilization time external main system clock input can be disabled (mstop = 1). internal high- speed oscillation clock operating current can be reduced by stopping internal high-speed oscillator (rstop = 1). x1 clock x1 oscillation can be stopped (mstop = 1). external main system clock external subsystem clock enabling input of external clock from exclks pin ? xtstart = 0, exclks = 1, oscsels = 1 external main system clock input can be disabled (mstop = 1). internal high- speed oscillation clock oscillation of internal high-speed oscillator and selection of internal high-speed oscillation clock as main system clock ? rstop = 0, mcs = 0 xt1 oscillation can be stopped or external subsystem clock input can be disabled (oscsels = 0). x1 clock stabilization of x1 oscillation and selection of high-speed system clock as main system clock ? mstop = 0, oscsel = 1, exclk = 0 ? after elapse of oscill ation stabilization time ? mcs = 1 ? xt1 oscillation can be stopped or external subsystem clock input can be disabled (oscsels = 0). ? clock supply to cpu is stopped for 4.06 to 16.12 s after amph has been set to 1. xt1 clock, external subsystem clock external main system clock enabling input of external clock from exclk pin and selection of high-speed system clock as main system clock ? mstop = 0, oscsel = 1, exclk = 1 ? mcs = 1 ? xt1 oscillation can be stopped or external subsystem clock input can be disabled (oscsels = 0). ? clock supply to cpu is stopped for the duration of 160 external clocks from the exclk pin after amph has been set to 1.
chapter 6 clock generator user?s manual u19180ej1v0ud 217 6.6.8 time required for switchover of cpu clock and main system clock by setting bits 0 to 2 (pcc0 to pcc2) and bit 4 (css) of the processor clock control register (pcc), the cpu clock can be switched (between the main system clock and the s ubsystem clock) and the division ratio of the main system clock can be changed. the actual switchover operation is not performed immediately after rewriti ng to pcc; operation continues on the pre-switchover clock for several clocks (see table 6-6 ). whether the cpu is operating on the main system clock or the subsystem clock can be ascertained using bit 5 (cls) of the pcc register. table 6-6. time required for switchover of cpu clock and main system clock cycle division factor set value before switchover set value after switchover css pcc2 pcc1 pcc0 css pcc2 pcc1 pcc0 css pcc2 pcc1 pcc0 css pcc2 pcc1 pcc0 css pcc2 pcc1 pcc0 css pcc2 pcc1 pcc0 css pcc2 pcc1 pcc0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 1 0 0 0 16 clocks 16 clocks 16 clocks 16 clocks 2f xp /f sub clocks 0 0 1 8 clocks 8 clocks 8 clocks 8 clocks f xp /f sub clocks 0 1 0 4 clocks 4 clocks 4 clocks 4 clocks f xp /2f sub clocks 0 1 1 2 clocks 2 clocks 2 clocks 2 clocks f xp /4f sub clocks 0 1 0 0 1 clock 1 clock 1 clock 1 clock f xp /8f sub clocks 1 2 clocks 2 clocks 2 clocks 2 clocks 2 clocks caution selection of the main system clock cycle di vision factor (pcc0 to pcc2) and switchover from the main system clock to the subsystem clock (changing css from 0 to 1) should not be set simultaneously. simultaneous setting is possible, however, for selection of the main system clock cycle division factor (pcc0 to pcc2) and switchover from the subsystem clock to the main system clock (changing css from 1 to 0). remarks 1. the number of clocks listed in table 6-6 is the number of cpu clocks before switchover. 2. when switching the cpu clock from the main syst em clock to the subsystem clock, calculate the number of clocks by rounding up to the next clock and discarding the decimal portion, as shown below. example when switching cpu clock from f xp /2 to f sub /2 (@ oscillation with f xp = 10 mhz, f sub = 32.768 khz) f xp /f sub = 10000/32.768 ? 305.1 306 clocks by setting bit 0 (mcm0) of the main clock mode register (m cm), the main system clock can be switched (between the internal high-speed oscillation clock and the high-speed system clock). the actual switchover operation is not performed immediately after rewriti ng to mcm0; operation continues on the pre-switchover clock for several clocks (see table 6-7 ). whether the cpu is operating on the inte rnal high-speed oscillation clock or the high-speed system clock can be ascertained using bit 1 (mcs) of mcm.
chapter 6 clock generator user?s manual u19180ej1v0ud 218 table 6-7. maximum time required for main system clock switchover set value before switchover set value after switchover mcm0 mcm0 0 1 0 1 + 2f rh /f xh clock 1 1 + 2f xh /f rh clock caution when switching the internal high-speed osc illation clock to the high-speed system clock, bit 2 (xsel) of mcm must be set to 1 in advance. the value of xsel can be changed only once after a reset release. remarks 1. the number of clocks listed in table 6-7 is the number of main system clocks before switchover. 2. calculate the number of clocks in t able 6-7 by removing the decimal portion. example when switching the main system clock from the internal high-speed oscillation clock to the high-speed system clock (@ oscillation with f rh = 8 mhz, f xh = 10 mhz) 1 + 2f rh /f xh = 1 + 2 8/10 = 1 + 2 0.8 = 1 + 1.6 = 2.6 2 clocks 6.6.9 conditions before clock oscillation is stopped the following lists the register flag settings for stopping th e clock oscillation (disabling external clock input) and conditions before the clock oscillation is stopped. table 6-8. conditions before the clock oscillation is stopped and flag settings clock conditions before clock oscillation is stopped (external clock input disabled) flag settings of sfr register internal high-speed oscillation clock mcs = 1 or cls = 1 (the cpu is operating on a clock other than the internal high-speed oscillation clock) rstop = 1 x1 clock external main system clock mcs = 0 or cls = 1 (the cpu is operating on a clock other than the high-speed system clock) mstop = 1 xt1 clock external subsystem clock cls = 0 (the cpu is operating on a clock other than the subsystem clock) oscsels = 0
user?s manual u19180ej1v0ud 219 chapter 7 16-bit timer/event counters 00 to 03 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 3 y = 4 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 16-bit timer/event counters 00 16-bit timer/event counters 01 note 1 note 2 16-bit timer/event counters 02 ? ? 16-bit timer/event counters 03 ? ? notes 1 . be careful to the following restrictions fo r function of 16-bit timer/event counter 01 for pd78f0881a, 78f0882a, and 78f0883a. ? selecting ti001 and ti011 for count clock is prohibited. w hen using ti001 for baud rate error calculation, it is not applicable. ? timer output is prohibited. for details, see 7.6 (12) 16-bit ti mer/event counter 01 of 78k0/fc2. 2. be careful to the following restrictions fo r function of 16-bit timer/event counter 01 for pd78f0884a, 78f0885a, 78f0886a, 78f0894a, and 78f0895a. ? selecting ti001 for count clock is prohibited. when us ing ti001 for baud rate error calculation, it is not applicable. for details, see 7.6 (12) 16-bit timer/event counter 01 of 78k0/fc2 . remark : mounted, ? : not mounted
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 220 7.1 functions of 16-bit timer/event counters 00 to 03 16-bit timer/event counters 00 to 03 have the following functions. ? interval timer ? ppg output ? pulse width measurement ? external event counter ? square-wave output ? one-shot pulse output (1) interval timer 16-bit timer/event counters 00 to 03 generate an in terrupt request at the preset time interval. (2) ppg output 16-bit timer/event counters 00 to 03 can output a re ctangular wave whose frequenc y and output pulse width can be set freely. (3) pulse width measurement 16-bit timer/event counters 00 to 03 can measure the pulse width of an externally input signal. (4) external event counter 16-bit timer/event counters 00 to 03 can measure the number of pulses of an externally input signal. (5) square-wave output 16-bit timer/event counters 00 to 03 can output a square wave with any selected frequency. (6) one-shot pulse output 16-bit timer event counters 00 to 03 can output a one-s hot pulse whose output pulse width can be set freely. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 221 7.2 configuration of 16-bit timer/event counters 00 to 03 16-bit timer/event counters 00 to 03 include the following hardware. table 7-1. configuration of 16-bit timer/event counters 00 to 03 item configuration timer counter 16 bits (tm0n) register 16-bit timer capture/compar e register: 16 bits (cr00n, cr01n) timer input ti00n, ti01n timer output to0n, output controller control registers 16-bit timer mode control register 0n (tmc0n) 16-bit timer capture/compare control register 0n (crc0n) 16-bit timer output control register 0n (toc0n) prescaler mode register 0n (prm0n) port mode register 0, 3, 13 (pm0, pm3, pm13) port register 0, 3, 13 (p0, p3, p13) remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2 figures 7-1 to 7-6 show the block diagrams. figure 7-1. block diagram of 16-bit timer/event counter 00 internal bus capture/compare control register 00 (crc00) ti010/to00/p01 f prs f prs /2 2 f prs /2 8 f prs ti000/p00 prescaler mode register 00 (prm00) 2 prm001 prm000 crc002 16-bit timer capture/compare register 010 (cr010) match match 16-bit timer counter 00 (tm00) clear noise elimi- nator crc002 crc001 crc000 inttm000 to00/ti010/ p01 inttm010 16-bit timer output control register 00 (toc00) 16-bit timer mode control register 00 (tmc00) internal bus tmc003 tmc002 tmc001 ovf00 toc004 lvs00 lvr00 toc001 toe00 selector 16-bit timer capture/compare register 000 (cr000) selector selector selector noise elimi- nator noise elimi- nator output controller ospe00 ospt00 output latch (p01) pm01
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 222 figure 7-2. block diagram of 16-bit timer/event counter 01 ( pd78f0881a, 78f0882a, 78f0883a of 78k0/fc2) internal bus capture/compare control register 01 (crc01) f prs f prs /2 4 f prs /2 6 f prs prescaler mode register 01 (prm01) 2 prm011 prm010 crc012 16-bit timer capture/compare register 011 (cr011) match match 16-bit timer counter 01 (tm01) clear noise elimi- nator crc012 crc011 crc010 inttm001 inttm011 16-bit timer output control register 01 (toc01) 16-bit timer mode control register 01 (tmc01) internal bus tmc013 tmc012 tmc011 ovf01 toc014 lvs01 lvr01 toc011 toe01 selector 16-bit timer capture/compare register 001 (cr001) selector selector selector noise elimi- nator noise elimi- nator output controller ospe01 ospt01 figure 7-3. block diagram of 16-bit timer/event counter 01 ( pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of 78k0/fc2) internal bus capture/compare control register 01 (crc01) ti011/to01/p06 f prs f prs /2 4 f prs /2 6 f prs prescaler mode register 01 (prm01) 2 prm011 prm010 crc012 16-bit timer capture/compare register 011 (cr011) match match 16-bit timer counter 01 (tm01) clear noise elimi- nator crc012 crc011 crc010 inttm001 to01/ti011/ p06 inttm011 16-bit timer output control register 01 (toc01) 16-bit timer mode control register 01 (tmc01) internal bus tmc013 tmc012 tmc011 ovf01 toc014 lvs01 lvr01 toc011 toe01 selector 16-bit timer capture/compare register 001 (cr001) selector selector selector noise elimi- nator noise elimi- nator output controller ospe01 ospt01 output latch (p06) pm06
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 223 figure 7-4. block diagram of 16-bit timer/event counter 01 (78k0/fe2, 78k0/ff2) internal bus capture/compare control register 01 (crc01) ti011/to01/p06 f prs f prs /2 4 f prs /2 6 f prs ti001/p05 prescaler mode register 01 (prm01) 2 prm011 prm010 crc012 16-bit timer capture/compare register 011 (cr011) match match 16-bit timer counter 01 (tm01) clear noise elimi- nator crc012 crc011 crc010 inttm001 to01/ti011/ p06 inttm011 16-bit timer output control register 01 (toc01) 16-bit timer mode control register 01 (tmc01) internal bus tmc013 tmc012 tmc011 ovf01 toc014 lvs01 lvr01 toc011 toe01 selector 16-bit timer capture/compare register 001 (cr001) selector selector selector noise elimi- nator noise elimi- nator output controller ospe01 ospt01 output latch (p06) pm06 figure 7-5. block diagram of 16-bit timer/event counter 02 internal bus capture/compare control register 02 (crc02) ti012/to02/ intp3/p32 f prs f prs /2 2 f prs /2 8 f prs ti002/intp2 /p31 prescaler mode register 02 (prm02) 2 prm021 prm020 crc022 16-bit timer capture/compare register 012 (cr012) match match 16-bit timer counter 02 (tm02) clear noise elimi- nator crc022 crc021 crc020 inttm002 to02/ti012/ intp3/p32 inttm012 16-bit timer output control register 02 (toc02) 16-bit timer mode control register 02 (tmc02) internal bus tmc023 tmc022 tmc021 ovf02 toc024 lvs02 lvr02 toc021 toe02 selector 16-bit timer capture/compare register 002 (cr002) selector selector selector noise elimi- nator noise elimi- nator output controller ospe02 ospt02 output latch (p32) pm32
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 224 figure 7-6. block diagram of 16-bit timer/event counter 03 internal bus capture/compare control register 03 (crc03) ti013/to03/p132 f prs f prs /2 4 f prs /2 6 f prs ti003/p131 prescaler mode register 03 (prm03) 2 prm031 prm030 crc032 16-bit timer capture/compare register 013 (cr013) match match 16-bit timer counter 03 (tm03) clear noise elimi- nator crc032 crc031 crc030 inttm003 to03/ti013/ p132 inttm013 16-bit timer output control register 03 (toc03) 16-bit timer mode control register 03 (tmc03) internal bus tmc033 tmc032 tmc031 ovf03 toc034 lvs03 lvr03 toc031 toe03 selector 16-bit timer capture/compare register 003 (cr003) selector selector selector noise elimi- nator noise elimi- nator output controller ospe03 ospt03 output latch (p132) pm132
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 225 (1) 16-bit timer counter 0n (tm0n) tm0n is a 16-bit read-only regist er that counts count pulses. the counter is incremented in synchronization with the rising edge of the count clock. if the count value is read during operat ion, then input of the count clock is temporarily stopped, and the count value at that point is read. figure 7-7. format of 16-bit timer counter 0n (tm0n) tm0n symbol ff11h (tm00) ffb1h (tm01) ff5bh (tm02) ffa7h (tm03) ff10h (tm00) ffb0h (tm01) ff5ah (tm02) ffa6h (tm03) address: ff10h, ff11h (tm00), ffb0h, ffb1h (tm01) after reset: 0000h r ff5ah, ff5bh (tm02), ffa6h, ffa7h (tm03) the count value is reset to 0000h in the following cases. <1> at reset signal generation <2> if tmc0n3 and tmc0n2 are cleared <3> if the valid edge of the ti00n pin is input in the mode in which clear & start occurs when inputting the valid edge of the ti00n pin <4> if tm0n and cr00n match in the mode in which clear & start occurs on a match of tm0n and cr00n <5> ospt0n is set to 1 in one-shot pulse output mode or the valid edge is input to the ti00n pin cautions 1. even if tm0n is read , the value is not captured by cr01n. 2. when tm0n is read, input of the count clo ck is temporarily stopped and it is resumed after the timer has been read. therefore, no clock miss occurs. 3. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 226 (2) 16-bit timer capture/compare register 00n (cr00n) cr00n is a 16-bit register that has t he functions of both a captur e register and a compare r egister. whether it is used as a capture register or as a comp are register is set by bit 0 (crc0n0) of capture/compar e control register 0n (crc0n). cr00n can be set by a 16-bit memory manipulation instruction. reset signal generation clears this register to 0000h. figure 7-8. format of 16-bit timer capture/compare register 00n (cr00n) cr00n symbol ff13h (cr000) ffb3h (cr001) ff6dh (cr002) ffa9h (cr003) ff12h (cr000) ffb2h (cr001) ff6ch (cr002) ffa8h (cr003) address: ff12h, ff13h (cr000), ffb2h, ffb3h (cr001) after reset: 0000h r/w ff6ch, ff6dh (cr002), ffa8h, ffa9h (cr003) ? when cr00n is used as a compare register the value set in cr00n is constantly compared with 16-bit timer counter 0n (t m0n) count value, and an interrupt request (inttm00n) is generated if they matc h. the set value is held until cr00n is rewritten. caution cr00n does not perform the capture operation when it is set in the comparison mode, even if a capture trigger is input to it. ? when cr00n is used as a capture register it is possible to select the valid edge of the ti00n pi n or the ti01n pin as the c apture trigger. the ti00n or ti01n pin valid edge is set using prescaler mode register 0n (prm0n) (see table 7-2 ). caution selecting ti001 and ti 011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 227 table 7-2. cr00n capture trigger and valid edges of ti00n and ti01n pins (1) ti00n pin valid edge selected as captu re trigger (crc0n1 = 1, crc0n0 = 1) ti00n pin valid edge cr00n capture trigger es0n1 es0n0 falling edge rising edge 0 1 rising edge falling edge 0 0 no capture operation both rising and falling edges 1 1 (2) ti01n pin valid edge selected as captu re trigger (crc0n1 = 0, crc0n0 = 1) ti01n pin valid edge cr00n capture trigger es1n1 es1n0 falling edge falling edge 0 0 rising edge rising edge 0 1 both rising and falling edges both rising and falling edges 1 1 cautions 1. set a value other than 0000h in cr00n in the mode in which clear & start occurs on a match of tm0n and cr00n. 2. if cr00n is cleared to 0000h in the free-running mode and in the clear m ode using the valid edge of the ti00n pin, an interrupt request (inttm00n) is generated when the value of cr00n changes from 0000h to 0001h following tm0n overflow (ffffh). in addition, inttm00n is generated after a match between tm0n and cr00n, after detecting the valid edge of the ti01n pin, and the timer is cleared by a one-shot trigger. 3. when p01 or p06 is used as the valid edge input of the ti01n pin, it cannot be used as the timer output (to0n). moreover, when p01 or p06 is used as to0n, it cannot be used as the valid edge input of the ti01n pin. 4. when cr00n is used as a capture register, read data is undefined if the register read time and capture trigger input conflict (the capture data itself is the correct value). if count stop input and capture trigger input conflict, the captured data is undefined. 5. do not rewrite cr00n during tm0n operation. 6. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remarks 1. setting es0n1, es0n0 = 1, 0 and es1n1, es1n0 = 1, 0 is prohibited. 2. es0n1, es0n0: bits 5 and 4 of prescaler mode register 0n (prm0n) es1n1, es1n0: bits 7 and 6 of prescaler mode register 0n (prm0n) crc0n1, crc0n0: bits 1 and 0 of capture/ compare control register 0n (crc0n) 3. n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 228 (3) 16-bit timer capture/compare register 01n (cr01n) cr01n is a 16-bit register that has t he functions of both a captur e register and a compare r egister. whether it is used as a capture register or a compar e register is set by bit 2 (crc0n2) of capture/compare c ontrol register 0n (crc0n). cr01n can be set by a 16-bit memory manipulation instruction. reset signal generation clears this register to 0000h. figure 7-9. format of 16-bit timer capture/compare register 01n (cr01n) cr01n (n = 0 to 3) symbol ff15h (cr010) ffb5h (cr011) ffedh (cr012) ffabh (cr013) ff14h (cr010) ffb4h (cr011) ffech (cr012) ffaah (cr013) address: ff14h, ff15h (cr010), ffb4h, ffb5h (cr011) after reset: 0000h r/w ffech, ffedh (cr012), ffaah, ffabh (cr013) ? when cr01n is used as a compare register the value set in the cr01n is constantly compared with 16-bit timer counter 0n (tm0n) count value, and an interrupt request (inttm01n) is generated if they matc h. the set value is held until cr01n is rewritten. ? when cr01n is used as a capture register it is possible to select the valid edge of the ti00n pin as the capture trigger. the ti00n pin valid edge is set by prescaler mode register 0n (prm0n) (see table 7-3 ).
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 229 table 7-3. cr01n capture trigger and valid edge of ti00n pin (crc0n2 = 1) ti00n pin valid edge cr01n capture trigger es0n1 es0n0 falling edge falling edge 0 0 rising edge rising edge 0 1 both rising and falling edges both rising and falling edges 1 1 cautions 1. if the cr01n register is cleared to 0000h, an interrupt request (inttm01n) is generated when the value of cr01n changes from 0000h to 0001h fo llowing tm0n overflow (ffffh). in addition, inttm01n is generated after a match between tm0n and cr01n, after detecting the valid edge of the ti00n pin, and the timer is cleared by a one-shot trigger. 2. when cr01n is used as a capture register, read data is undefined if the register read time and capture trigger input conflict (the capture data itself is the correct value). if count stop input and capture trigger input conflict, the captured data is undefined. 3. cr01n can be rewritten during tm0n operation. for details, see 7.5.1 rewriting cr01n during tm0n operation. 4. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remarks 1. setting es0n1, es0n0 = 1, 0 is prohibited. 2. es0n1, es0n0: bits 5 and 4 of prescaler mode register 0n (prm0n) crc0n2: bit 2 of capture/compar e control register 0n (crc0n) 3. n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 230 (4) setting range when cr00n or cr01n is used as a compare register when cr00n or cr01n is used as a compare register, set it as shown below. operation cr00n register setting range cr01n register setting range operation as interval timer operation as square-wave output operation as external event counter 0000h < n ffffh 0000h note m ffffh normally, this setting is not used. mask the match interrupt signal (inttm01n). operation in the clear & start mode entered by ti00n pin valid edge input operation as free-running timer 0000h note n ffffh 0000h note m ffffh operation as ppg output m < n ffffh 0000h note m < n operation as one-shot pulse output 0000h note n ffffh (n m) 0000h note m ffffh (m n) note when 0000h is set, a match interrupt immediately after the timer operation does not occur and timer output is not changed, and the first match timing is as follows . a match interrupt occurs at the timing when the timer counter (tm0n register) is changed from 0000h to 0001h. ? when the timer counter is cleared due to overflow ? when the timer counter is cleared due to ti00n pin valid edge (when clear & start mode is entered by ti00n pin valid edge input) ? when the timer counter is cleared due to compare ma tch (when clear & start mode is entered by match between tm0n and cr00n (cr00n = other than 0000h, cr01n = 0000h)) operation enabled (other than 00) tm0n register timer counter clear interrupt signal is not generated interrupt signal is generated timer operation enable bit (tmc0n3, tmc0n2) interrupt request signal c ompare register set value (0000h) operation disabled (00) caution selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remarks 1. n: cr00n register set value, m: cr01n register set value 2. for details of tmc0n3 and tmc0n2, see 7.3 (1) 16-bit timer mode control register 0n (tmc0n) . 3. n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 231 table 7-4. capture operation of cr00n and cr01n external input signal capture operation ti00n pin input ti01n pin input set values of es0n1 and es0n0 position of edge to be captured set values of es1n1 and es1n0 position of edge to be captured 01: rising 01: rising 00: falling 00: falling crc0n1 = 1 ti00n pin input (reverse phase) 11: both edges (cannot be captured) crc0n1 bit = 0 ti01n pin input 11: both edges capture operation of cr00n interrupt signal inttm00n signal is not generated even if value is captured. interrupt signal inttm00n signal is generated each time value is captured. set values of es0n1 and es0n0 position of edge to be captured 01: rising 00: falling ti00n pin input note 11: both edges capture operation of cr01n interrupt signal inttm01n signal is generated each time value is captured. note the capture operation of cr01n is not affected by the setting of the crc0n1 bit. cautions 1. to capture the count value of the tm0n register to the cr00n re gister by using the phase reverse to that input to the ti00n pin, the interrupt request signal (inttm00n) is not generated after the value has been captured. if the valid edge is detected on the ti01n pin during this operation, the capture operation is not performed but the inttm00n signal is generated as an external interrupt signal. to not use the external interrupt, mask the inttm00n signal. 2. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remarks 1. crc0n1: see 7.3 (2) capture/compare control register 0n (crc0n) . es1n1, es1n0, es0n1, es0n0: see 7.3 (4) prescaler mode register 0n (prm0n) . 2. n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 232 7.3 registers controlling 16-bi t timer/event counters 00 to 03 the following six registers are used to c ontrol 16-bit timer/event counters 00 to 03. ? 16-bit timer mode control register 0n (tmc0n) ? capture/compare contro l register 0n (crc0n) ? 16-bit timer output control register 0n (toc0n) ? prescaler mode register 0n (prm0n) ? port mode register 0, 3, 13 (pm0, pm3, pm13) ? port register 0, 3, 13 (p0, p3, p13) (1) 16-bit timer mode control register 0n (tmc0n) this register sets the 16-bit time r operating mode, the 16-bit timer c ounter 0n (tm0n) clear mode, and output timing, and detects an overflow. rewriting tmc0n is prohibited during operation (when tm c0n3 and tmc0n2 = other than 00). however, it can be changed when tmc0n3 and tmc0n2 are cleared to 00 (st opping operation) and when ovf0n is cleared to 0. tmc0n can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears tmc0n to 00h. caution 16-bit timer/event counter 0n starts operation at the moment tmc0n2 and tmc0n3 are set to values other than 0, 0 (operation stop mode), respectively. set tmc0n2 and tmc0n3 to 0, 0 to stop the operation. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 233 figure 7-10. format of 16-bit timer mode control register 00 (tmc00) address: ffbah after reset: 00h r/w symbol 7 6 5 4 3 2 1 <0> tmc00 0 0 0 0 tmc003 tmc002 tmc001 ovf00 tmc003 tmc002 operation enable of 16-bit timer/event counter 00 0 0 disables 16-bit timer/event counter 00 operation. stops supplying operating clock. clears 16-bit timer counter 00 (tm00). 0 1 free-running timer mode 1 0 clear & start mode entered by ti000 pin valid edge input note 1 1 clear & start mode entered upon a match between tm00 and cr000 tmc001 condition to reverse timer output (to00) 0 ? match between tm00 and cr000 or match between tm00 and cr010 1 ? match between tm00 and cr000 or match between tm00 and cr010 ? trigger input of ti000 pin valid edge ovf00 tm00 overflow flag clear (0) clears ovf00 to 0 or tmc003 and tmc002 = 00 set (1) overflow occurs. ovf00 is set to 1 when the value of tm00 changes from ffffh to 0000h in all the operation modes (free-running timer mode, clear & start mode entered by ti000 pin valid edge input, and clear & start mode entered upon a match between tm00 and cr000). it can also be set to 1 by writing 1 to ovf00. note the ti000 pin valid edge is set by bits 5 and 4 ( es001, es000) of prescaler mode register 00 (prm00). remark to00: 16-bit timer/event counter 00 output pin ti000: 16-bit timer/event counter 00 input pin tm00: 16-bit timer counter 00 cr000: 16-bit timer capture/compare register 000 cr010: 16-bit timer capture/compare register 010
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 234 figure 7-11. format of 16-bit timer mode control register 01 (tmc01) address: ffb6h after reset: 00h r/w symbol 7 6 5 4 3 2 1 <0> tmc01 0 0 0 0 tmc013 tmc012 tmc011 ovf01 tmc013 tmc012 operation enable of 16-bit timer/event counter 01 0 0 disables 16-bit timer/event counter 01 operation. stops supplying operating clock. clears 16-bit timer counter 01. 0 1 free-running timer mode 1 0 clear & start mode entered by ti001 pin valid edge input note 1 1 clear & start mode entered upon a match between tm01 and cr001 tmc011 condition to reverse timer output (to01) 0 ? match between tm01 and cr001 or match between tm01 and cr011 1 ? match between tm01 and cr001 or match between tm01 and cr011 ? trigger input of ti001 pin valid edge ovf01 tm01 overflow flag clear (0) clears ovf01 to 0 or tmc013 and tmc012 = 00 set (1) overflow occurs. ovf01 is set to 1 when the value of tm01 changes from ffffh to 0000h in all the operation modes (free-running timer mode, clear & start mode entered by ti001 pin valid edge input, and clear & start mode entered upon a match between tm01 and cr001). it can also be set to 1 by writing 1 to ovf01. notes 1. the ti001 pin valid edge is set by bits 5 and 4 ( es011, es010) of prescaler mode register 01 (prm01). 2. 78k0/fe2, 78k0/ff2 only. setti ng is prohibited at 78k0/fc2. 3. 78k0/fe2, 78k0/ff2 only. remark to01: 16-bit timer/event counter 01 output pin ti001: 16-bit timer/event counter 01 input pin tm01: 16-bit timer counter 01 cr001: 16-bit timer capture/compare register 001 cr011: 16-bit timer capture/compare register 011
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 235 figure 7-12. format of 16-bit timer mode control register 02 (tmc02) address: ff54h after reset: 00h r/w symbol 7 6 5 4 3 2 1 <0> tmc02 0 0 0 0 tmc023 tmc022 tmc021 ovf02 tmc023 tmc022 operation enable of 16-bit timer/event counter 02 0 0 disables 16-bit timer/event counter 02 operation. stops supplying operating clock. clears 16-bit timer counter 02 (tm02). 0 1 free-running timer mode 1 0 clear & start mode entered by ti002 pin valid edge input note 1 1 clear & start mode entered upon a match between tm02 and cr002 tmc021 condition to reverse timer output (to02) 0 ? match between tm02 and cr002 or match between tm02 and cr012 1 ? match between tm02 and cr002 or match between tm02 and cr012 ? trigger input of ti002 pin valid edge ovf02 tm02 overflow flag clear (0) clears ovf02 to 0 or tmc023 and tmc022 = 00 set (1) overflow occurs. ovf02 is set to 1 when the value of tm02 changes from ffffh to 0000h in all the operation modes (free-running timer mode, clear & start mode entered by ti002 pin valid edge input, and clear & start mode entered upon a match between tm02 and cr002). it can also be set to 1 by writing 1 to ovf02. note the ti002 pin valid edge is set by bits 5 and 4 ( es021, es020) of prescaler mode register 02 (prm02). remark to02: 16-bit timer/event counter 02 output pin ti002: 16-bit timer/event counter 02 input pin tm02: 16-bit timer counter 02 cr002: 16-bit timer capture/compare register 002 cr012: 16-bit timer capture/compare register 012
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 236 figure 7-13. format of 16-bit timer mode control register 03 (tmc03) address: ffadh after reset: 00h r/w symbol 7 6 5 4 3 2 1 <0> tmc03 0 0 0 0 tmc033 tmc032 tmc031 ovf03 tmc033 tmc032 operation enable of 16-bit timer/event counter 03 0 0 disables 16-bit timer/event counter 03 operation. stops supplying operating clock. clears 16-bit timer counter 03 (tm03). 0 1 free-running timer mode 1 0 clear & start mode entered by ti003 pin valid edge input note 1 1 clear & start mode entered upon a match between tm03 and cr003 tmc031 condition to reverse timer output (to03) 0 ? match between tm03 and cr003 or match between tm03 and cr013 1 ? match between tm03 and cr003 or match between tm03 and cr013 ? trigger input of ti003 pin valid edge ovf03 tm03 overflow flag clear (0) clears ovf03 to 0 or tmc033 and tmc032 = 00 set (1) overflow occurs. ovf03 is set to 1 when the value of tm03 changes from ffffh to 0000h in all the operation modes (free-running timer mode, clear & start mode entered by ti003 pin valid edge input, and clear & start mode entered upon a match between tm03 and cr003). it can also be set to 1 by writing 1 to ovf03. note the ti003 pin valid edge is set by bits 5 and 4 ( es031, es030) of prescaler mode register 03 (prm03). remark to03: 16-bit timer/event counter 03 output pin ti003: 16-bit timer/event counter 03 input pin tm03: 16-bit timer counter 03 cr003: 16-bit timer capture/compare register 003 cr013: 16-bit timer capture/compare register 013
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 237 (2) capture/compare contro l register 0n (crc0n) crc0n is the register that controls the operation of cr00n and cr01n. changing the value of crc0n is prohibited during oper ation (when tmc0n3 and tmc0n2 = other than 00). crc0n can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears crc0n to 00h. figure 7-14. format of capture/compare control register 00 (crc00) address: ffbch after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 crc00 0 0 0 0 0 crc002 crc001 crc000 crc002 cr010 operating mode selection 0 operates as compare register 1 operates as capture register crc001 cr000 capture trigger selection 0 captures on valid edge of ti010 pin 1 captures on valid edge of ti000 pin by reverse phase note the valid edge of the ti010 and ti000 pin is set by prm00. if es001 and es000 are set to 11 (both edges) when crc001 is 1, the valid edge of the ti000 pin cannot be detected. crc000 cr000 operating mode selection 0 operates as compare register 1 operates as capture register if tmc003 and tmc002 are set to 11 (clear & start mode entered upon a match between tm00 and cr000), be sure to set crc000 to 0. note when the valid edge is detected from the ti010 pin, the capture opera tion is not performed but the inttm000 signal is generated as an external interrupt signal. caution to ensure that the capture operation is perf ormed properly, the capture trigger requires a pulse two cycles longer than the c ount clock selected by prescaler mode register 00 (prm00). remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 238 figure 7-15. example of cr01n capture op eration (when rising edge is specified) count clock tm0n ti00n rising edge detection cr01n inttm01n n ? 3n ? 2n ? 1 n n + 1 n valid edge remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2 figure 7-16. format of capture/compare control register 01 (crc01) address: ffb8h after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 crc01 0 0 0 0 0 crc012 note 1 crc011 note 2 crc010 note 1 crc012 cr011 operating mode selection 0 operates as compare register 1 operates as capture register crc011 cr001 capture trigger selection 0 captures on valid edge of ti011 pin 1 captures on valid edge of ti001 pin by reverse phase note 3 the valid edge of the ti011 and ti001 pin is set by prm01. if es011 and es010 are set to 11 (both edges) when crc011 is 1, the valid edge of the ti001 pin cannot be detected. crc010 cr001 operating mode selection 0 operates as compare register 1 operates as capture register if tmc013 and tmc012 are set to 11 (clear & start mode entered upon a match between tm01 and cr001), be sure to set crc010 to 0. notes 1. be sure to set to bit 2 and 0 of crc01 to 0 in pd78f0881a, 78f0882a and 78f0883a of the 78k0/fc2. 2. be sure to set to bit 1 of crc01 to 0 in 78k0/fc2. 3. when the valid edge is detected from the ti011 pin, the capture oper ation is not performed but the inttm001 signal is generated as an external interrupt signal. caution to ensure that the capture operation is perf ormed properly, the capture trigger requires a pulse two cycles longer than the count clock selected by prescaler mode register 01 (prm01) (see figure 7-15 example of cr01n capture oper ation (when rising edge is specified)).
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 239 figure 7-17. format of capture/compare control register 02 (crc02) address: ff5ch after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 crc02 0 0 0 0 0 crc022 crc021 crc020 crc022 cr012 operating mode selection 0 operates as compare register 1 operates as capture register crc021 cr002 capture trigger selection 0 captures on valid edge of ti012 pin 1 captures on valid edge of ti002 pin by reverse phase note the valid edge of the ti012 and ti002 pin is set by prm02. if es021 and es020 are set to 11 (both edges) when crc021 is 1, the valid edge of the ti002 pin cannot be detected. crc020 cr002 operating mode selection 0 operates as compare register 1 operates as capture register if tmc023 and tmc022 are set to 11 (clear & start mode entered upon a match between tm02 and cr002), be sure to set crc020 to 0. note when the valid edge is detected from the ti012 pin, the capture opera tion is not performed but the inttm002 signal is generated as an external interrupt signal. caution to ensure that the capture operation is perf ormed properly, the capture trigger requires a pulse two cycles longer than the count clock selected by prescaler mode register 02 (prm02) (see figure 7-15 example of cr01n capture oper ation (when rising edge is specified)).
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 240 figure 7-18. format of capture/compare control register 03 (crc03) address: ff52h after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 crc03 0 0 0 0 0 crc032 crc031 crc030 crc032 cr013 operating mode selection 0 operates as compare register 1 operates as capture register crc031 cr003 capture trigger selection 0 captures on valid edge of ti013 pin 1 captures on valid edge of ti003 pin by reverse phase note the valid edge of the ti013 and ti003 pin is set by prm03. if es031 and es030 are set to 11 (both edges) when crc031 is 1, the valid edge of the ti003 pin cannot be detected. crc030 cr003 operating mode selection 0 operates as compare register 1 operates as capture register if tmc033 and tmc032 are set to 11 (clear & start mode entered upon a match between tm03 and cr003), be sure to set crc030 to 0. note when the valid edge is detected from the ti013 pin, the capture opera tion is not performed but the inttm003 signal is generated as an external interrupt signal. caution to ensure that the capture operation is perf ormed properly, the capture trigger requires a pulse two cycles longer than the count clock selected by prescaler mode register 03 (prm03) (see figure 7-15 example of cr01n capture oper ation (when rising edge is specified).
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 241 (3) 16-bit timer output control register 0n (toc0n) toc0n is an 8-bit register that controls the to0n pin output. toc0n can be rewritten while only ospt0n is oper ating (when tmc0n3 and tmc0n2 = other than 00). rewriting the other bits is prohibited during operation. however, toc0n4 can be rewritten during time r operation as a means to rewrite cr01n (see 7.5.1 rewriting cr01n during tm0n operation ). toc0n can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears toc0n to 00h. caution be sure to set toc0n using the following procedure. <1> set toc0n4 and toc0n1 to 1. <2> set only toe0n to 1. <3> set either of lvs0n or lvr0n to 1. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 242 figure 7-19. format of 16-bit timer output control register 00 (toc00) address: ffbdh after reset: 00h r/w symbol 7 <6> <5> 4 <3> <2> 1 <0> toc00 0 ospt00 ospe00 toc004 lvs00 lvr00 toc001 toe00 ospt00 one-shot pulse output trigger via software 0 ? 1 one-shot pulse output the value of this bit is always ?0? when it is read. do not set this bit to 1 in a mode other than the one- shot pulse output mode. if it is set to 1, tm00 is cleared and started. ospe00 one-shot pulse output operation control 0 successive pulse output 1 one-shot pulse output one-shot pulse output operates correctly in the fr ee-running timer mode or clear & start mode entered by ti000 pin valid edge input. the one-shot pulse cannot be output in the clear & start mode entered upon a match between tm00 and cr000. toc004 to00 pin output control on match between cr010 and tm00 0 disables inversion operation 1 enables inversion operation the interrupt signal (inttm010) is generated even when toc004 = 0. lvs00 lvr00 setting of to00 pin output status 0 0 no change 0 1 initial value of to00 pin output is low level (to00 pin output is cleared to 0). 1 0 initial value of to00 pin output is high level (to00 pin output is set to 1). 1 1 setting prohibited ? lvs00 and lvr00 can be used to set the initial value of the output level of the to00 pin. if the initial value does not have to be set, leave lvs00 and lvr00 as 00. ? be sure to set lvs00 and lvr00 when toe00 = 1. lvs00, lvr00, and toe00 being simultaneously set to 1 is prohibited. ? lvs00 and lvr00 are trigger bits. by setting these bits to 1, the initial value of the output level of the to00 pin can be set. even if thes e bits are cleared to 0, output of the to00 pin is not affected. ? the values of lvs00 and lvr00 are always 0 when they are read. ? for how to set lvs00 and lvr00, see 7.5.2 setting lvs0n and lvr0n . toc001 to00 pin output control on match between cr000 and tm00 0 disables inversion operation 1 enables inversion operation the interrupt signal (inttm000) is generated even when toc001 = 0. toe00 to00 pin output control 0 disables output (to00 pin output fixed to low level) 1 enables output
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 243 figure 7-20. format of 16-bit timer output control register 01 (toc01) address: ffb9h after reset: 00h r/w symbol 7 <6> <5> 4 <3> <2> 1 <0> toc01 0 ospt01 note 1 ospe01 note 1 toc014 note 1 lvs01 note 1 lvr01 note 1 toc011 note 1 toe01 note 1 ospt01 one-shot pulse output trigger via software 0 ? 1 one-shot pulse output the value of this bit is always 0 when it is read. do not set this bit to 1 in a mode other than the one-shot pulse output mode. if it is set to 1, tm01 is cleared and started. ospe01 one-shot pulse output operation control 0 successive pulse output 1 one-shot pulse output one-shot pulse output operates correctly in the fr ee-running timer mode or clear & start mode entered by ti001 pin valid edge input note 2 . the one-shot pulse cannot be output in the clear & start mode entered upon a match between tm01 and cr001. toc014 to01 pin output control on match between cr011 and tm01 0 disables inversion operation 1 enables inversion operation the interrupt signal (inttm011) is generated even when toc014 = 0. lvs01 lvr01 setting of to01 pin output status 0 0 no change 0 1 initial value of to01 pin output is low level (to01 pin output is cleared to 0). 1 0 initial value of to01 pin output is high level (to01 pin output is set to 1). 1 1 setting prohibited ? lvs01 and lvr01 can be used to set the initial value of the output level of the to01 pin. if the initial value does not have to be set, leave lvs01 and lvr01 as 00. ? be sure to set lvs01 and lvr01 when toe01 = 1. lvs01, lvr01, and toe01 being simultaneously set to 1 is prohibited. ? lvs01 and lvr01 are trigger bits. by setting these bits to 1, the initial value of the output level of the to01 pin can be set. even if thes e bits are cleared to 0, output of the to01 pin is not affected. ? the values of lvs01 and lvr01 are always 0 when they are read. ? for how to set lvs01 and lvr01, see 7.5.2 setting lvs0n and lvr0n . toc011 to01 pin output control on match between cr001 and tm01 0 disables inversion operation 1 enables inversion operation the interrupt signal (inttm001) is generated even when toc011 = 0. toe01 to01 pin output control 0 disables output (to01 pin output is fixed to low level) 1 enables output notes 1. be sure to set to bit 6 to 0 of toc01 to 0 in pd78f0881a, 78f0882a and 78f0883a of the 78k0/fc2. 2. 78k0/fe2, 78k0/ff2 only.
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 244 figure 7-21. format of 16-bit timer output control register 02 (toc02) address: ffa5h after reset: 00h r/w symbol 7 <6> <5> 4 <3> <2> 1 <0> toc02 0 ospt02 ospe02 toc024 lvs02 lvr02 toc021 toe02 ospt02 one-shot pulse output trigger via software 0 ? 1 one-shot pulse output the value of this bit is always 0 when it is read. do not set this bit to 1 in a mode other than the one-shot pulse output mode. if it is set to 1, tm02 is cleared and started. ospe02 one-shot pulse output operation control 0 successive pulse output 1 one-shot pulse output one-shot pulse output operates correctly in the fr ee-running timer mode or clear & start mode entered by ti002 pin valid edge input. the one-shot pulse cannot be output in the clear & start mode entered upon a match between tm02 and cr002. toc024 to02 pin output control on match between cr012 and tm02 0 disables inversion operation 1 enables inversion operation the interrupt signal (inttm012) is generated even when toc024 = 0. lvs02 lvr02 setting of to02 pin output status 0 0 no change 0 1 initial value of to02 pin output is low level (to02 pin output is cleared to 0). 1 0 initial value of to02 pin output is high level (to02 pin output is set to 1). 1 1 setting prohibited ? lvs02 and lvr02 can be used to set the initial value of the output level of the to02 pin. if the initial value does not have to be set, leave lvs02 and lvr02 as 00. ? be sure to set lvs02 and lvr02 when toe02 = 1. lvs02, lvr02, and toe02 being simultaneously set to 1 is prohibited. ? lvs02 and lvr02 are trigger bits. by setting these bits to 1, the initial value of the output level of the to02 pin can be set. even if thes e bits are cleared to 0, output of the to02 pin is not affected. ? the values of lvs02 and lvr02 are always 0 when they are read. ? for how to set lvs02 and lvr02, see 7.5.2 setting lvs0n and lvr0n . toc021 to02 pin output control on match between cr002 and tm02 0 disables inversion operation 1 enables inversion operation the interrupt signal (inttm002) is generated even when toc021 = 0. toe02 to02 pin output control 0 disables output (to02 pin output is fixed to low level) 1 enables output
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 245 figure 7-22. format of 16-bit timer output control register 03 (toc03) address: fff9h after reset: 00h r/w symbol 7 <6> <5> 4 <3> <2> 1 <0> toc03 0 ospt03 ospe03 toc034 lvs03 lvr03 toc031 toe03 ospt03 one-shot pulse output trigger via software 0 ? 1 one-shot pulse output the value of this bit is always 0 when it is read. do not set this bit to 1 in a mode other than the one-shot pulse output mode. if it is set to 1, tm03 is cleared and started. ospe03 one-shot pulse output operation control 0 successive pulse output 1 one-shot pulse output one-shot pulse output operates correctly in the fr ee-running timer mode or clear & start mode entered by ti003 pin valid edge input. the one-shot pulse cannot be output in the clear & start mode entered upon a match between tm03 and cr003. toc034 to03 pin output control on match between cr013 and tm03 0 disables inversion operation 1 enables inversion operation the interrupt signal (inttm013) is generated even when toc034 = 0. lvs03 lvr03 setting of to03 pin output status 0 0 no change 0 1 initial value of to03 pin output is low level (to03 pin output is cleared to 0). 1 0 initial value of to03 pin output is high level (to03 pin output is set to 1). 1 1 setting prohibited ? lvs03 and lvr03 can be used to set the initial value of the output level of the to03 pin. if the initial value does not have to be set, leave lvs03 and lvr03 as 00. ? be sure to set lvs03 and lvr03 when toe03 = 1. lvs03, lvr03, and toe03 being simultaneously set to 1 is prohibited. ? lvs03 and lvr03 are trigger bits. by setting these bits to 1, the initial value of the output level of the to03 pin can be set. even if thes e bits are cleared to 0, output of the to03 pin is not affected. ? the values of lvs03 and lvr03 are always 0 when they are read. ? for how to set lvs03 and lvr03, see 7.5.2 setting lvs0n and lvr0n . toc031 to03 pin output control on match between cr003 and tm03 0 disables inversion operation 1 enables inversion operation the interrupt signal (inttm003) is generated even when toc031 = 0. toe03 to03 pin output control 0 disables output (to03 pin output is fixed to low level) 1 enables output
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 246 (4) prescaler mode register 0n (prm0n) prm0n is the register that se ts the tm0n count clock and ti00n and ti01n pin input valid edges. rewriting prm0n is prohibited during operati on (when tmc0n3 and tmc0n2 = other than 00). prm0n can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears prm0n to 00h. cautions 1. do not apply the following setting when setting the prm0n1 and prm0n0 bits to 11 (to specify the valid edge of the ti00n pin as a count clock). ? clear & start mode entered by the ti00n pin valid edge ? setting the ti00n pin as a capture trigger 2. if the operation of the 16-bit timer/event counter 0n is enabled when the ti00n or ti01n pin is at high level and when the valid edge of the ti00n or ti01n pin is specified to be the rising edge or both edges, the high level of the ti00n or ti01n pin is detected as a rising edge. note this when the ti00n or ti01n pin is pulled up. however, the rising edge is not detected when the timer operation has been once stopped and then is enabled again. 3. the valid edge of ti010 and timer output (to 00) cannot be used for the p01 pin at the same time, and the valid edge of ti011 and timer output (to01) cannot be used for the p06 pin at the same time. select either of the functions. 4. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 247 figure 7-23. format of prescaler mode register 00 (prm00) address: ffbbh after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 prm00 es101 es100 es001 es000 0 0 prm001 prm000 es101 es100 ti010 pin valid edge selection 0 0 falling edge 0 1 rising edge 1 0 setting prohibited 1 1 both falling and rising edges es001 es000 ti000 pin valid edge selection 0 0 falling edge 0 1 rising edge 1 0 setting prohibited 1 1 both falling and rising edges count clock selection note 1 prm001 prm000 f prs = 4 mhz f prs = 5 mhz f prs = 10 mhz f prs = 20 mhz 0 0 f prs note 2 4 mhz 5 mhz 10 mhz note 3 20 mhz note 4 0 1 f prs /2 2 1 mhz 1.25 mhz 2.5 mhz 5 mhz 1 0 f prs /2 8 15.62 khz 19.53 khz 39.06 khz 78.12 khz 1 1 ti000 valid edge note 5 notes 1. the frequency that can be used for the peripheral hardware clock (f prs ) differs depending on the power supply voltage and product specifications. supply voltage peripheral hardware clock frequency 4.0 v v dd 5.5 v f prs 20 mhz 2.7 v v dd < 4.0 v f prs 10 mhz 1.8 v v dd < 2.7 v ((a) grade products only) f prs 5 mhz (the values shown in the table above are those when f prs = f xh (xsel = 1).) 2. if the peripheral hardware clock (f prs ) operates on the internal high-speed oscillation clock (f rh ) (xsel = 0), when 1.8 v v dd < 2.7 v, the setting of prm001 = prm000 = 0 (count clock: f prs ) is prohibited. 3. this is settable only if 2.7 v v dd 5.5 v. 4. this is settable only if 4.0 v v dd 5.5 v. 5. the external clock requires a pulse longer than twice the cycle of the peripheral hardware clock (f prs ). remark f prs : peripheral hardware clock frequency
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 248 figure 7-24. format of prescaler mode register 01 (prm01) address: ffb7h after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 prm01 es111 note 1 es110 note 1 es011 note 2 es010 note 2 0 0 prm011 prm010 es111 es110 ti011 pin valid edge selection 0 0 falling edge 0 1 rising edge 1 0 setting prohibited 1 1 both falling and rising edges es011 es010 ti001 pin valid edge selection 0 0 falling edge 0 1 rising edge 1 0 setting prohibited 1 1 both falling and rising edges count clock selection note 3 prm011 prm010 f prs = 4 mhz f prs = 5 mhz f prs = 10 mhz f prs = 20 mhz 0 0 f prs note 4 4 mhz 5 mhz 10 mhz note 5 20 mhz note 6 0 1 f prs /2 4 250 khz 312.5 khz 625 khz 1.25 mhz 1 0 f prs /2 6 62.5 khz 78.125 khz 156.25 khz 312.5 khz 1 1 ti001 valid edge notes 7, 8 notes 1. be sure to set to bits 6 and 7 to 0 of prm01 to 0 in pd78f0881a, 78f0882a and 78f0883a of the 78k0/fc2. 2. be sure to set to bits 4 and 5 of prm01 to 0 in 78k0/fc2. 3. the frequency that can be used for the peripheral hardware clock (f prs ) differs depending on the power supply voltage and product specifications. supply voltage peripheral hardware clock frequency 4.0 v v dd 5.5 v f prs 20 mhz 2.7 v v dd < 4.0 v f prs 10 mhz 1.8 v v dd < 2.7 v ((a) grade products only) f prs 5 mhz (the values shown in the table above are those when f prs = f xh (xsel = 1).) 4. if the peripheral hardware clock (f prs ) operates on the internal high-speed oscillation clock (f rh ) (xsel = 0), when 1.8 v v dd < 2.7 v, the setting of prm011 = prm010 = 0 (count clock: f prs ) is prohibited. 5. this is settable only if 2.7 v v dd 5.5 v. 6. this is settable only if 4.0 v v dd 5.5 v. 7. the external clock requires a pulse longer than twice the cycle of the peripheral hardware clock (f prs ). 8. 78k0/fe2, 78k0/ff2 only. setti ng is prohibited at 78k0/fc2. remark f prs : peripheral hardware clock frequency
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 249 figure 7-25. format of prescaler mode register 02 (prm02) address: ff59h after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 prm02 es121 es120 es021 es020 0 0 prm021 prm020 es121 es120 ti012 pin valid edge selection 0 0 falling edge 0 1 rising edge 1 0 setting prohibited 1 1 both falling and rising edges es021 es020 ti002 pin valid edge selection 0 0 falling edge 0 1 rising edge 1 0 setting prohibited 1 1 both falling and rising edges count clock selection note 1 prm021 prm020 f prs = 4 mhz f prs = 5 mhz f prs = 10 mhz f prs = 20 mhz 0 0 f prs note 2 4 mhz 5 mhz 10 mhz note 3 20 mhz note 4 0 1 f prs /2 2 1 mhz 1.25 mhz 2.5 mhz 5 mhz 1 0 f prs /2 8 15.62 khz 19.53 khz 39.06 khz 78.12 khz 1 1 ti002 valid edge note 5 notes 1. the frequency that can be used for the peripheral hardware clock (f prs ) differs depending on the power supply voltage and product specifications. supply voltage peripheral hardware clock frequency 4.0 v v dd 5.5 v f prs 20 mhz 2.7 v v dd < 4.0 v f prs 10 mhz 1.8 v v dd < 2.7 v ((a) grade products only) f prs 5 mhz (the values shown in the table above are those when f prs = f xh (xsel = 1).) 2. if the peripheral hardware clock (f prs ) operates on the internal high-speed oscillation clock (f rh ) (xsel = 0), when 1.8 v v dd < 2.7 v, the setting of prm021 = prm020 = 0 (count clock: f prs ) is prohibited. 3. this is settable only if 2.7 v v dd 5.5 v. 4. this is settable only if 4.0 v v dd 5.5 v. 5. the external clock requires a pulse longer than twice the cycle of the peripheral hardware clock (f prs ). remark f prs : peripheral hardware clock frequency
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 250 figure 7-26. format of prescaler mode register 03 (prm03) address: ff51h after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 prm03 es131 es130 es031 es030 0 0 prm031 prm030 es131 es130 ti013 pin valid edge selection 0 0 falling edge 0 1 rising edge 1 0 setting prohibited 1 1 both falling and rising edges es031 es030 ti003 pin valid edge selection 0 0 falling edge 0 1 rising edge 1 0 setting prohibited 1 1 both falling and rising edges count clock selection note 1 prm031 prm030 f prs = 4 mhz f prs = 5 mhz f prs = 10 mhz f prs = 20 mhz 0 0 f prs note 2 4 mhz 5 mhz 10 mhz 20 mhz note 3 0 1 f prs /2 4 250 khz 312.5 khz 625 khz 1.25 mhz 1 0 f prs /2 6 62.5 khz 78.125 khz 156.25 khz 312.5 khz 1 1 ti003 valid edge note 4 notes 1. the frequency that can be used for the peripheral hardware clock (f prs ) differs depending on the power supply voltage and product specifications. supply voltage peripheral hardware clock frequency 4.0 v v dd 5.5 v f prs 20 mhz 2.7 v v dd < 4.0 v f prs 10 mhz 1.8 v v dd < 2.7 v ((a) grade products only) f prs 5 mhz (the values shown in the table above are those when f prs = f xh (xsel = 1).) 2. if the peripheral hardware clock (f prs ) operates on the internal high-speed oscillation clock (f rh ) (xsel = 0), when 1.8 v v dd < 2.7 v, the setting of prm031 = prm030 = 0 (count clock: f prs ) is prohibited. 3. this is settable only if 2.7 v v dd 5.5 v. 4. this is settable only if 4.0 v v dd 5.5 v. 5. the external clock requires a pulse longer than twice the cycle of the peripheral hardware clock (f prs ). remark f prs : peripheral hardware clock frequency
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 251 (5) port mode register 0 (pm0) this register sets port 0 input/output in 1-bit units. when using the p01/to00/ti010 and p 06/to01/ti011 pins for timer outpu t, set pm01 and pm06 and the output latch of p01 and p06 to 0. when using the p01/to00/ti010 and p06/to01/ti011 pins for ti mer input, set pm01 and pm06 to 1. at this time, the output latch of p01 and p06 may be 0 or 1. pm0 can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation sets pm0 to ffh. figure 7-27. format of port mode register 0 (pm0) address: ff20h after reset: ffh r/w symbol 7 6 5 4 3 2 1 0 pm0 1 pm06 pm05 1 1 1 pm01 pm00 pm0n p0n pin i/o mode selection (n = 0, 1, 5, 6) 0 output mode (output buffer on) 1 input mode (output buffer off) remark the figure shown above presents the format of port mode register 0 of 78k0/ff2 products. for the format of port mode regi ster 0 of other products, see (1) port mode registers (pmxx) in 5.3 registers controlling port function . (6) port mode register 3 (pm3) this register sets port 3 input/output in 1-bit units. when using the p32/to02/ti012/intp3 note 1 pin for timer output, set pm32 and the output latch of p32 to 0. when using the p31/ti002/intp2 note 2 and p32/ti012/to02/intp3 note 1 pins for timer input, set pm31 and pm32 to 1. at this time, the output la tch of p31 and p32 may be 0 or 1. pm3 can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation sets pm3 to ffh. notes 1. ti002 pin is not mounted in 78k0/fc 2. port functions other than ti002 as well as shared functions are provided. 2. ti012, to02 pins are not mounted in 78k0/fc2. port functions other than ti012 and to02 as well as shared functions are provided. figure 7-28. format of port mode register 3 (pm3) address: ff23h after reset: ffh r/w symbol 7 6 5 4 3 2 1 0 pm3 1 1 1 1 pm33 pm32 pm31 pm30 pm3n p3n pin i/o mode selection (n = 0 to 3) 0 output mode (output buffer on) 1 input mode (output buffer off)
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 252 (7) port mode register 13 (pm13) this register sets port 13 input/output in 1-bit units. when using the p132/to03/ti013 pin for timer output, set pm132 and the output latch of p132 to 0. when using the p131/ti003 and p132/ti013/to03 pins for ti mer input, set pm131 and pm132 to 1. at this time, the output latch of p131 a nd p132 may be 0 or 1. pm13 can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation sets pm13 to ffh. figure 7-29. format of port mode register 13 (pm13) address: ff2dh after reset: ffh r/w symbol 7 6 5 4 3 2 1 0 pm13 1 1 1 1 1 pm132 pm131 0 pm13n p13n pin i/o mode selection (n = 1, 2) 0 output mode (output buffer on) 1 input mode (output buffer off) remark the figure shown above presents the format of port mode register 0 of 78k0/ff2 products. for the format of port mode regi ster 0 of other products, see (1) port mode registers (pmxx) in 5.3 registers controlling port function .
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 253 7.4 operation of 16-bit timer/event counters 00 to 03 7.4.1 interval timer operation setting 16-bit timer mode control register 0n (tmc0n) and capture/compare control register 0n (crc0n) as shown in figure 7-28 allows operation as an interval timer. setting the basic operation setting procedure is as follows. <1> set the crc0n register (see figure 7-30 for the set value). <2> set any value to the cr00n register. <3> set the count clock by using the prm0n register. <4> set the tmc0n register to start the operation (see figure 7-30 for the set value). caution cr00n cannot be rewritten during tm0n operation. remark for how to enable the inttm00n interrupt, see chapter 17 interrupt functions . interrupt requests are generated repeatedly using the count value preset in 16-bit time r capture/compare register 00n (cr00n) as the interval. when the count value of 16-bit timer counter 0n (tm0n) ma tches the value set in cr00n, counting continues with the tm0n value cleared to 0 and the interrupt request signal (inttm00n) is generated. the count clock of 16-bit timer/event counter 0n can be selected with bits 0 and 1 (prm0n0, prm0n1) of prescaler mode register 0n (prm0n). remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 254 figure 7-30. control register settings for interval timer operation (a) 16-bit timer mode cont rol register 0n (tmc0n) 7 0 6 0 5 0 4 0 tmc0n3 1 tmc0n2 1 tmc0n1 0/1 ovf0n 0 tmc0n clears and starts on match between tm0n and cr00n. (b) capture/compare cont rol register 0n (crc0n) 7 0 6 0 5 0 4 0 3 0 crc0n2 0/1 crc0n1 0/1 crc0n0 0 crc0n cr00n used as compare register (c) prescaler mode register 0n (prm0n) es1n1 0/1 es1n0 0/1 es0n1 0/1 es0n0 0/1 3 0 2 0 prm0n1 0/1 prm0n0 0/1 prm0n selects count clock. setting invalid (setting ?10? is prohibited.) setting invalid (setting ?10? is prohibited.) note note note 78k0/fc2 is prm00 only. be su re to set to 0 in prm01. remarks 1. 0/1: setting 0 or 1 allows another function to be used simultaneously with the interval timer. see the description of the respective control registers for details. 2. n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 255 figure 7-31. interval timer configuration diagram 16-bit timer capture/compare register 00n (cr00n) 16-bit timer counter 0n (tm0n) ovf0n clear circuit inttm00n f prs (f prs ) note 1 f prs /2 2 (f prs /2 4 ) note 1 f prs /2 8 (f prs /2 6 ) note 1 ti000/p00 (ti001/p05) ti002/p31 (ti003/p131) note 1 selector noise eliminator f prs note 2 notes 1. frequencies and pin names without parentheses ar e for 16-bit timer/event counter 00 and 02, and those in parentheses are for 16-bi t timer/event counter 01 and 03. 2. ovf0n is set to 1 only when 16-bit timer capture/compare register 00n is set to ffffh. figure 7-32. timing of interval timer operation count clock t tm0n count value cr00n inttm00n 0000h 0001h n 0000h 0001h n 0000h 0001h n n n n n timer operation enabled clear clear interrupt acknowledged interrupt acknowledged remarks 1. interval time = (n + 1) t n = 0001h to ffffh 2. n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 256 7.4.2 ppg output operations setting 16-bit timer mode control register 0n (tmc0n) and capture/compare control register 0n (crc0n) as shown in figure 7-33 allows operation as ppg (programmable pulse generator) output. setting the basic operation setting procedure is as follows. <1> set the crc0n register (see figure 7-33 for the set value). <2> set any value to the cr00n register as the cycle. <3> set any value to the cr01n register as the duty factor. <4> set the toc0n register (see figure 7-33 for the set value). <5> set the count clock by using the prm0n register. <6> set the tmc0n register to start the operation (see figure 7-33 for the set value). caution to change the value of the duty factor (the value of the cr01n register) during operation, see caution 2 in figure 7-35 ppg output operation timing. remarks 1. for the setting of the to0n pin, see 7.3 (5) port mode register 0 (pm0) to (7) port mode register 13 (pm13) . 2. for how to enable the inttm00n interrupt, see chapter 17 interrupt functions . in the ppg output operation, rectangular waves are output from the to0n pin with the pulse width and the cycle that correspond to the count values pr eset in 16-bit timer capture/compare r egister 01n (cr01n) and in 16-bit timer capture/compare register 00n (cr00n), respectively. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 257 figure 7-33. control register settings for ppg output operation (a) 16-bit timer mode cont rol register 0n (tmc0n) 7 0 6 0 5 0 4 0 tmc0n3 1 tmc0n2 1 tmc0n1 0 ovf0n 0 tmc0n clears and starts on match between tm0n and cr00n. (b) capture/compare cont rol register 0n (crc0n) 7 0 6 0 5 0 4 0 3 0 crc0n2 0 crc0n1 crc0n0 0 crc0n cr00n used as compare register cr01n used as compare register (c) 16-bit timer output control register 0n (toc0n) 7 0 ospt0n 0 ospe0n 0 toc0n4 1 lvs0n 0/1 lvr0n 0/1 toc0n1 1 toe0n 1 toc0n enables to0n output. inverts output on match between tm0n and cr00n. specifies initial value of to0n output f/f (setting ?11? is prohibited). inverts output on match between tm0n and cr01n. disables one-shot pulse output. (d) prescaler mode register 0n (prm0n) es1n1 0/1 es1n0 0/1 es0n1 0/1 es0n0 0/1 3 0 2 0 prm0n1 0/1 prm0n0 0/1 prm0n selects count clock. setting invalid (setting ?10? is prohibited.) setting invalid (setting ?10? is prohibited.) note note note 78k0/fc2 is prm00 only. be su re to set to 0 in prm01. cautions 1. values in the following range should be set in cr00n and cr01n: 0000h cr01n < cr00n ffffh 2. the cycle of the pulse generated through ppg out put (cr00n setting value + 1) has a duty of (cr01n setting value + 1)/(cr00n setting value + 1). remark : don?t care n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 258 figure 7-34. configuration diagram of ppg output 16-bit timer capture/compare register 00n (cr00n) 16-bit timer counter 0n (tm0n) clear circuit noise eliminator f prs f prs (f prs ) note f prs /2 2 (f prs /2 4 ) note f prs /2 8 (f prs /2 6 ) note ti000/p00 (ti001/p05) ti002/p31 (ti003/p131) note 16-bit timer capture/compare register 01n (cr01n) to00/ti010/p01 (to01/ti011/p06) to02/ti012/p32 (to03/ti013/p132) note selector output controller note frequencies and pin names without parentheses are for 16-bit timer/event counter 00 and 02, and those in parentheses are for 16-bit timer/event counter 01 and 03. figure 7-35. ppg output operation timing t 0000h 0000h 0001h 0001h m ? 1 count clock tm0n count value to0n pulse width: (m + 1) t 1 cycle: (n + 1) t n cr00n capture value cr01n capture value m m n ? 1 n n clear clear cautions 1. cr00n cannot be rewritten during tm0n operation. 2. in the ppg output operation, change the pulse width (rewrite cr01n) during tm0n operation using the following procedure. <1> disable the timer output inversion operation by match of tm0n and cr01n (toc0n4 = 0) <2> disable the inttm01n interrupt (tmmk01n = 1) <3> rewrite cr01n <4> wait for 1 cycle of the tm0n count clock <5> enable the timer output inversion operation by match of tm0n and cr01n (toc0n4 = 1) <6> clear the interrupt request flag of inttm01n (tmif01n = 0) <7> enable the inttm01n interrupt (tmmk01n = 0) remarks 1. 0000h m < n ffffh 2. n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 259 7.4.3 pulse width measurement operations it is possible to measure the pulse width of the signal s input to the ti00n pin and ti01n pin using 16-bit timer counter 0n (tm0n). there are two measurement methods : measuring with tm0n used in free-running mode, and measuring by restarting the timer in synchronization with the edge of the signal input to the ti00n pin. when an interrupt occurs, read the valid value of the capt ure register, check the overflow flag, and then calculate the necessary pulse width. clear the overflow flag after checking it. the capture operation is not performed until the signal pulse width is sa mpled in the count clock cycle selected by prescaler mode register 0n (prm0n) and the valid level of the ti00n or ti01n pin is dete cted twice, thus eliminating noise with a short pulse width. figure 7-36. cr01n capture operat ion with rising edge specified count clock tm0n ti00n rising edge detection cr01n inttm01n n ? 3n ? 2n ? 1 n n + 1 n setting the basic operation setting procedure is as follows. <1> set the crc0n register (see figures 7-37 , 7-40 , 7-42 , and 7-44 for the set value). <2> set the count clock by using the prm0n register. <3> set the tmc0n register to start the operation (see figures 7-37 , 7-40 , 7-42 , and 7-44 for the set value). cautions 1. to use two capture registers, set the ti00n and ti01n pins. 2. only 16-bit timer/event counter 00 can use the pulse width measu rement of 78k0/fc2. 3. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remarks 1. for the setting of the ti00n (or ti01n) pin, see 7.3 (5) port mode register 0 (pm0) to (7) port mode register 13 (pm13) . 2. for how to enable the inttm00n (or inttm01n) interrupt, see chapter 17 interrupt functions . 3. n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 260 (1) pulse width measurement with free-r unning counter and one capture register when 16-bit timer counter 0n (tm0n) is operated in free-ru nning mode, and the edge specified by prescaler mode register 0n (prm0n) is input to the ti00n pin, the value of tm0n is taken into 16-bit timer capture/compare register 01n (cr01n) and an external interrupt request signal (inttm01n) is set. specify both the rising and falling edges of the ti00n pin by using bits 4 and 5 (es0n0 and es0n1) of prm0n. sampling is performed using the c ount clock selected by prm0n, and a capture operation is only performed when a valid level of the ti00n pin is detected twice, thus eliminating noise with a short pulse width. figure 7-37. control register settings for pul se width measurement with free-running counter and one capture register (when ti00n and cr01n are used) (a) 16-bit timer mode cont rol register 0n (tmc0n) 7 0 6 0 5 0 4 0 tmc0n3 0 tmc0n2 1 tmc0n1 0/1 ovf0n 0 tmc0n free-running mode (b) capture/compare cont rol register 0n (crc0n) 7 0 6 0 5 0 4 0 3 0 crc0n2 1 crc0n1 0/1 crc0n0 0 c rc0n cr00n used as compare regist er cr01n used as capture registe r (c) prescaler mode register 0n (prm0n) es1n1 0/1 es1n0 0/1 es0n1 1 es0n0 1 3 0 2 0 prm0n1 0/1 prm0n0 0/1 prm0n selects count clock (setting ?11? is prohibited). specifies both edges for pulse width detection. setting invalid (setting ?10? is prohibited.) cautions 1. only 16-bit timer/event counter 00 can use the pulse width m easurement of 78k0/fc2. 2. selecting ti001 and ti 011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remarks 1. 0/1: setting 0 or 1 allows another function to be used simultaneously with pulse width measurement. see the description of the respecti ve control registers for details. 2. n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 261 figure 7-38. configuration di agram for pulse width measureme nt with free-running counter f prs (f prs ) note f prs /2 2 (f prs /2 4 ) note f prs /2 8 (f prs /2 6 ) note ti00n 16-bit timer counter 0n (tm0n) ovf0n 16-bit timer capture/compare register 01n (cr01n) internal bus inttm01n selector note frequencies without parentheses are for 16-bit timer/ event counter 00 and 02, and those in parentheses are for 16-bit timer/event counter 01 and 03. figure 7-39. timing of pulse width measurement operation with free-running counter and one capture register (with both edges specified) t 0000h 0000h ffffh 0001h d0 d0 count clock tm0n count value ti00n pin input cr01n capture value inttm01n ovf0n (d1 ? d0) t (d3 ? d2) t (10000h ? d1 + d2) t d1 d2 d3 d2 d3 d0 + 1 d1 d1 + 1 note note clear ovf0n by software. cautions 1. only 16-bit timer/event counter 00 can use the pulse width m easurement of 78k0/fc2. 2. selecting ti001 and ti 011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 262 (2) measurement of two pulse wi dths with free-running counter when 16-bit timer counter 0n (tm0n) is operated in free- running mode, it is possible to simultaneously measure the pulse widths of the two signals in put to the ti00n pin and the ti01n pin. when the edge specified by bits 4 and 5 (es0n0 and es0n1) of prescaler mode register 0n (prm0n) is input to the ti00n pin, the value of tm0n is taken into 16-bit time r capture/compare register 01n (cr01n) and an interrupt request signal (inttm01n) is set. also, when the edge specified by bits 6 and 7 (es1n0 and es1n1) of prm0n is input to the ti01n pin, the value of tm0n is taken into 16-bit timer capture/compare register 00n (cr00n) and an interrupt request signal (inttm00n) is set. specify both the rising and falling edges as the edges of the ti00n and ti01n pins, by using bits 4 and 5 (es0n0 and es0n1) and bits 6 and 7 (es1n0 and es1n1) of prm0n. sampling is performed using the count clock cycle se lected by prescaler mode register 0n (prm0n), and a capture operation is only performed when a valid level of the ti00n or ti01n pin is detected twice, thus eliminating noise with a short pulse width. cautions 1. only 16-bit timer/event counter 00 can use the pulse width m easurement of 78k0/fc2. 2. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 263 figure 7-40. control register se ttings for measurement of two pul se widths with free-running counter (a) 16-bit timer mode cont rol register 0n (tmc0n) 7 0 6 0 5 0 4 0 tmc0n3 0 tmc0n2 1 tmc0n1 0/1 ovf0n 0 tmc0n free-running mode (b) capture/compare cont rol register 0n (crc0n) 7 0 6 0 5 0 4 0 3 0 crc0n2 1 crc0n1 0 crc0n0 1 crc0n cr00n used as capture register captures valid edge of ti01n pin to cr00n. cr01n used as capture register (c) prescaler mode register 0n (prm0n) es1n1 1 es1n0 1 es0n1 1 es0n0 1 3 0 2 0 prm0n1 0/1 prm0n0 0/1 prm0n selects count clock (setting ?11? is prohibited). specifies both edges for pulse width detection. specifies both edges for pulse width detection. cautions 1. only 16-bit timer/event counter 00 can use the pulse width m easurement of 78k0/fc2. 2. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remarks 1. 0/1: setting 0 or 1 allows another function to be used simultaneously with pulse width measurement. see the description of the respecti ve control registers for details. 2. n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 264 figure 7-41. timing of pulse width measurement operation with free-running counter (with both edges specified) t 0000h 0000h ffffh 0001h d0 d0 ti01n pin input cr00n capture value inttm01n inttm00n ovf0n (d1 ? d0) t (d3 ? d2) t (10000h ? d1 + d2) t (10000h ? d1 + (d2 + 1)) t d1 d2 + 1 d1 d2 d2 d3 d0 + 1 d1 d1 + 1 d2 + 1 d2 + 2 count clock tm0n count value ti00n pin input cr01n capture value note note clear ovf0n by software. cautions 1. only 16-bit timer/event counter 00 can use the pulse width m easurement of 78k0/fc2. 2. selecting ti001 and ti 011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 265 (3) pulse width measurement with free-r unning counter and two capture registers when 16-bit timer counter 0n (tm0n) is operated in free-running mode, it is possible to measure the pulse width of the signal input to the ti00n pin. when the rising or falling edge specified by bits 4 a nd 5 (es0n0 and es0n1) of prescaler mode register 0n (prm0n) is input to the ti00n pin, t he value of tm0n is taken into 16-bit timer capture/compare register 01n (cr01n) and an interrupt request signal (inttm01n) is set. also, when the inverse edge to that of the capture operation is input into cr 01n, the value of tm0n is taken into 16-bit timer capture/compare register 00n (cr00n). sampling is performed using the count clock cycle se lected by prescaler mode register 0n (prm0n), and a capture operation is only per formed when a valid level of the ti00n pin is detected twice, thus eliminating noise with a short pulse width. cautions 1. only 16-bit timer/event counter 00 can use the pulse width m easurement of 78k0/fc2. 2. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 266 figure 7-42. control register settings for pulse width measurement with free-running counter and two capture registers (with rising edge specified) (a) 16-bit timer mode cont rol register 0n (tmc0n) 7 0 6 0 5 0 4 0 tmc0n3 0 tmc0n2 1 tmc0n1 0/1 ovf0n 0 t mc0n free-running mod e (b) capture/compare cont rol register 0n (crc0n) 7 0 6 0 5 0 4 0 3 0 crc0n2 1 crc0n1 1 crc0n0 1 crc0n cr00n used as capture register captures to cr00n at inverse edge to valid edge of ti00n. cr01n used as capture register (c) prescaler mode register 0n (prm0n) es1n1 0/1 es1n0 0/1 es0n1 0 es0n0 1 3 0 2 0 prm0n1 0/1 prm0n0 0/1 prm0n selects count clock (setting ?11? is prohibited). specifies rising edge for pulse width detection. setting invalid (setting ?10? is prohibited.) cautions 1. only 16-bit timer/event counter 00 can use the pulse width m easurement of 78k0/fc2. 2. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remarks 1. 0/1: setting 0 or 1 allows another function to be used simultaneously with pulse width measurement. see the description of the re spective control registers for details. 2. n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 267 figure 7-43. timing of pulse wi dth measurement operation with free-running counter and two capture registers (with rising edge specified) t 0000h 0000h ffffh 0001h d0 d0 inttm01n ovf0n d2 d1 d3 d2 d3 d0 + 1 d2 + 1 d1 d1 + 1 cr00n capture value count clock tm0n count value ti00n pin input cr01n capture value (d1 ? d0) t (d3 ? d2) t (10000h ? d1 + d2) t note note clear ovf0n by software. cautions 1. only 16-bit timer/event counter 00 can use the pulse width m easurement of 78k0/fc2. 2. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. (4) pulse width measurement by means of restart when input of a valid edge to the ti00n pin is detected, th e count value of 16-bit timer counter 0n (tm0n) is taken into 16-bit timer capture/compare register 01n (cr01n), and then the pulse width of t he signal input to the ti00n pin is measured by clearing tm0n and restarting the count operation. either of two edges ? rising or falling ? can be selected using bits 4 and 5 ( es0n0 and es0n1) of prescaler mode register 0n (prm0n). sampling is performed using the count clock cycle se lected by prescaler mode register 0n (prm0n) and a capture operation is only per formed when a valid level of the ti00n pin is detected twice, thus eliminating noise with a short pulse width. cautions 1. only 16-bit timer/event counter 00 can use the pulse width m easurement of 78k0/fc2. 2. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 268 figure 7-44. control register settings for pulse width measurement by means of restart (with rising edge specified) (a) 16-bit timer mode cont rol register 0n (tmc0n) 7 0 6 0 5 0 4 0 tmc0n3 1 tmc0n2 0 tmc0n1 0/1 ovf0n 0 tmc0n clears and starts at valid edge of ti00n pin. (b) capture/compare cont rol register 0n (crc0n) 7 0 6 0 5 0 4 0 3 0 crc0n2 1 crc0n1 1 crc00n 1 crc0n cr00n used as capture register captures to cr00n at inverse edge to valid edge of ti00n. cr01n used as capture register (c) prescaler mode register 0n (prm0n) es1n1 0/1 es1n0 0/1 es0n1 0 es0n0 1 3 0 2 0 prm0n1 0/1 prm0n0 0/1 prm0n selects count clock (setting ?11? is prohibited). specifies rising edge for pulse width detection. setting invalid (setting ?10? is prohibited.) cautions 1. only 16-bit timer/event counter 00 can use the pulse width m easurement of 78k0/fc2. 2. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 269 figure 7-45. timing of pulse width measurement operat ion by means of restart (with rising edge specified) t 0000h 0001h 0000h 0001h 0000h 0001h d0 d0 inttm01n d1 t d2 t d2 d1 d2 d1 cr00n capture value count clock tm0n count value ti00n pin input cr01n capture value cautions 1. only 16-bit timer/event counter 00 can use the pulse width m easurement of 78k0/fc2. 2. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 270 7.4.4 external event counter operation setting the basic operation setting procedure is as follows. <1> set the crc0n register (see figure 7-46 for the set value). <2> set the count clock by using the prm0n register. <3> set any value to the cr00n register (0000h cannot be set). <4> set the tmc0n register to start the operation (see figure 7-46 for the set value). remarks 1. for the setting of the ti00n pin, see 7.3 (5) port mode register 0 (pm0) to (7) port mode register 13 (pm13) . 2. for how to enable the inttm00n interrupt, see chapter 17 interrupt functions . the external event counter counts the number of external clock pulses input to the ti00n pin using 16-bit timer counter 0n (tm0n). tm0n is incremented each time the valid edge specified by prescaler mode register 0n (prm0n) is input. when the tm0n count value matches the 16-bit timer capt ure/compare register 00n (cr00n) value, tm0n is cleared to 0 and the interrupt r equest signal (inttm00n) is generated. input a value other than 0000h to cr00n (a count operation with 1-bit pulse cannot be carried out). any of three edges ? rising, falling, or both edges ? can be selected using bits 4 and 5 (es0n0 and es0n1) of prescaler mode register 0n (prm0n). sampling is performed using the internal clock (f prs ) and an operation is only performed when a valid level of the ti00n pin is detected twice, thus elimi nating noise with a short pulse width. cautions 1. only 16-bit timer/event counter 00 can use the external event counter of 78k0/fc2. 2. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 271 figure 7-46. control register settings in external event counter mode (with rising edge specified) (a) 16-bit timer mode cont rol register 0n (tmc0n) 7 0 6 0 5 0 4 0 tmc0n3 1 tmc0n2 1 tmc0n1 0/1 ovf0n 0 tmc0n clears and starts on match between tm0n and cr00n. (b) capture/compare cont rol register 0n (crc0n) 7 0 6 0 5 0 4 0 3 0 crc0n2 0/1 crc0n1 0/1 crc0n0 0 crc0n cr00n used as compare register (c) prescaler mode register 0n (prm0n) es1n1 0/1 es1n0 0/1 es0n1 0 es0n0 1 3 0 2 0 prm0n1 1 prm0n0 1 prm0n selects external clock. specifies rising edge for pulse width detection. setting invalid (setting ?10? is prohibited.) cautions 1. only 16-bit timer/event counter 00 can use the external event counter of 78k0/fc2. 2. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remarks 1. 0/1: setting 0 or 1 allows another function to be used simultaneously with the external event counter. see the description of the re spective control registers for details. 2. n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 272 figure 7-47. configuration diagram of external event counter f prs internal bus 16-bit timer capture/compare register 00n (cr00n) match clear ovf0n note noise eliminator 16-bit timer counter 0n (tm0n) valid edge of ti00n pin inttm00n note ovf0n is set to 1 only when cr00n is set to ffffh. figure 7-48. external event counter operation timing (with rising edge specified) ti00n pin input tm0n count value cr00n inttm00n 0000h 0001h 0002h 0003h 0004h 0005h n ? 1 n 0000h 0001h 0002h 0003h n cautions 1. when reading the external event counter count value, tm0n should be read. 2. only 16-bit timer/event counter 00 can use the external event counter of 78k0/fc2. 3. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 273 7.4.5 square-wave output operation setting the basic operation setting procedure is as follows. <1> set the count clock by using the prm0n register. <2> set the crc0n register (see figure 7-49 for the set value). <3> set the toc0n register (see figure 7-49 for the set value). <4> set any value to the cr00n register (0000h cannot be set). <5> set the tmc0n register to start the operation (see figure 7-49 for the set value). caution cr00n cannot be rewritten during tm0n operation. remarks 1. for the setting of the to0n pin, see 7.3 (5) port mode register 0 (pm0) to (7) port mode register 13 (pm13) . 2. for how to enable the inttm00n interrupt, see chapter 17 interrupt functions . a square wave with any selected frequency can be output at intervals determined by the count value preset to 16- bit timer capture/compare register 00n (cr00n). the to0n pin output status is reversed at intervals determined by the count value preset to cr00n + 1 by setting bit 0 (toe0n) and bit 1 (toc0n1) of 16-bit timer output control register 0n (toc0n) to 1. this enables a square wave with any selected frequency to be output. figure 7-49. control register settings in square-wave output mode (1/2) (a) 16-bit timer mode cont rol register 0n (tmc0n) 7 0 6 0 5 0 4 0 tmc0n3 1 tmc0n2 1 tmc0n1 0 ovf0n 0 tmc0n clears and starts on match between tm0n and cr00n. (b) capture/compare cont rol register 0n (crc0n) 7 0 6 0 5 0 4 0 3 0 crc0n2 0/1 crc0n1 0/1 crc0n0 0 crc0n cr00n used as compare register remarks 1. 0/1: setting 0 or 1 allows another function to be used simultaneously with square-wave output. see the description of the respecti ve control registers for details. 2. n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 274 figure 7-49. control register settings in square-wave output mode (2/2) (c) 16-bit timer output control register 0n (toc0n) 7 0 ospt0n 0 ospe0n 0 toc0n4 0 lvs0n 0/1 lvr0n 0/1 toc0n1 1 toe0n 1 toc0n enables to0n output. inverts output on match between tm0n and cr00n. specifies initial value of to0n output f/f (setting ?11? is prohibited). does not invert output on match between tm0n and cr01n. disables one-shot pulse output. (d) prescaler mode register 0n (prm0n) es1n1 0/1 es1n0 0/1 es0n1 0/1 es0n0 0/1 3 0 2 0 prm0n1 0/1 prm0n0 0/1 prm0n selects count clock. setting invalid (setting ?10? is prohibited.) setting invalid (setting ?10? is prohibited.) note note note 78k0/fc2 is prm00 only. be sure to set to 0 in prm01 remark 0/1: setting 0 or 1 allows another function to be used simultaneously with square-wave output. see the description of the respective control registers for details. n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2 figure 7-50. square-wave output operation timing count clock tm0n count value cr00n inttm00n to0n pin output 0000h 0001h 0002h n ? 1 n 0000h 0001h 0002h n ? 1 n 0000h n remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 275 7.4.6 one-shot pulse output operation 16-bit timer/event counter 0n can output a one-shot pulse in synchronization with a software trigger or an external trigger (ti00n pin input). setting the basic operation setting procedure is as follows. <1> set the count clock by using the prm0n register. <2> set the crc0n register (see figures 7-51 and 7-53 for the set value). <3> set the toc0n register (see figures 7-51 and 7-53 for the set value). <4> set any value to the cr00n and cr01n registers (0000h cannot be set). <5> set the tmc0n register to start the operation (see figures 7-51 and 7-53 for the set value). caution selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remarks 1. for the setting of the to0n pin, see 7.3 (5) port mode register 0 (pm0) to (7) port mode register 13 (pm13) . 2. for how to enable the inttm00n (if necessary, inttm01n) interrupt, see chapter 17 interrupt functions .
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 276 (1) one-shot pulse output with software trigger a one-shot pulse can be output from t he to0n pin by setting 16-bit timer mode control register 0n (tmc0n), capture/compare control register 0n (crc0n), and 16-bit timer output control register 0n (toc0n) as shown in figure 7-49, and by setting bit 6 (ospt0n) of the toc0n register to 1 by software. by setting the ospt0n bit to 1, 16-bit timer/event counter 0n is cleared and star ted, and its output becomes active at the count value (n) set in advance to 16-bit time r capture/compare register 01n (cr01n). after that, the output becomes inactive at the count value (m) set in advance to 16-bit timer capture/compare register 00n (cr00n) note . even after the one-shot pulse has been output, the tm0n r egister continues its oper ation. to stop the tm0n register, the tmc0n3 and tmc0n2 bits of t he tmc0n register must be set to 00. note the case where n < m is described here. when n > m, the output becomes active with the cr00n register and inactive with the cr01n register. do not set n to m. cautions 1. do not set the ospt0n bit while the one-shot pulse is being output. to output the one- shot pulse again, wait until the current one-shot pulse output is completed. 2. when using the one-shot pulse output of 16-bit timer/event counter 0n with a software trigger, do not change the level of the ti00n pin or its alternate-function port pin. because the external trigger is valid even in this case, the timer is cleared and started even at the level of the ti00n pin or its altern ate-function port pin, resulting in the output of a pulse at an undesired timing. 3. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 277 figure 7-51. control register settings for one-shot pulse output with software trigger (a) 16-bit timer mode cont rol register 0n (tmc0n) 0000 7654 0 tmc0n3 tmc0n tmc0n2 tmc0n1 ovf0n free-running mode 100 (b) capture/compare cont rol register 0n (crc0n) 00000 76543 crc0n crc0n2 crc0n1 crc0n0 cr00n as compare register cr01n as compare register 0 0/1 0 (c) 16-bit timer output control register 0n (toc0n) 0 7 0 1 1 0/1 toc0n lvr0n lvs0n toc0n4 ospe0n ospt0n toc0n1 toe0n enables to0n output. inverts output upon match between tm0n and cr00n. specifies initial value of to0n output f/f (setting ?11? is prohibited.) inverts output upon match between tm0n and cr01n. sets one-shot pulse output mode. set to 1 for output. 0/1 1 1 (d) prescaler mode register 0n (prm0n) 0/1 0/1 0/1 0/1 0 prm0n prm0n1 prm0n0 selects count clock. setting invalid (setting ?10? is prohibited.) 0 0/1 0/1 es1n1 es1n0 es0n1 es0n0 setting invalid (setting ?10? is prohibited.) 32 note note note 78k0/fc2 is prm00 only. be sure to set to 0 in prm01 caution do not set 0000h to the cr00n and cr01n registers. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 278 figure 7-52. timing of one-shot pulse output operation with software trigger 0000h n nn n n mm m m nm n + 1 n ? 1 m ? 1 0001h m + 1 m + 2 0000h count clock tm0n count c r01n set value c r00n set value ospt0n inttm01n inttm00n to0n pin output set tmc0n to 04h (tm0n count starts) caution 16-bit timer counter 0n starts operating as soon as a value other than 00 (operation stop mode) is set to the tmc0n3 and tmc0n2 bits. remark n < m (2) one-shot pulse output with external trigger a one-shot pulse can be output from t he to0n pin by setting 16-bit timer mode control register 0n (tmc0n), capture/compare control register 0n (crc0n), and 16-bit timer output control register 0n (toc0n) as shown in figure 7-51, and by using the valid edge of the ti00n pin as an external trigger. the valid edge of the ti00n pin is specified by bits 4 and 5 (es0n0, es0n1) of pr escaler mode register 0n (prm0n). the rising, falling, or both the rising and falling edges can be specified. when the valid edge of the ti00n pin is detected, the 16-bit time r/event counter is clear ed and started, and the output becomes active at the count value set in advance to 16-bit timer capture/compare register 01n (cr01n). after that, the output becomes inactive at the count value set in advance to 16-bit timer capture/compare register 00n (cr00n) note . note the case where n < m is described here. when n > m, the output becomes active with the cr00n register and inactive with the cr01n register. do not set n to m. cautions 1. even if the external trigger is generated again while the one-shot pulse is output, it is ignored. 2. only 16-bit timer/event counter 00 can use the one-shot pulse output with external trigger of 78k0/fc2. 3. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 279 figure 7-53. control register settings for one-shot pulse output with external trigger (with rising edge specified) (a) 16-bit timer mode cont rol register 0n (tmc0n) 0000 7654 1 tmc0n3 tmc0n tmc0n2 tmc0n1 ovf0n clears and starts at valid edge of ti00n pin. 000 (b) capture/compare cont rol register 0n (crc0n) 00000 76543 crc0n crc0n2 crc0n1 crc0n0 cr00n used as compare register cr01n used as compare register 0 0/1 0 (c) 16-bit timer output control register 0n (toc0n) 0 7 01 1 0/1 toc0n lvr0n toc0n1 toe0n ospe0n ospt0n toc0n4 lvs0n enables to0n output. inverts output upon match between tm0n and cr00n. specifies initial value of to0n output f/f (setting ?11? is prohibited.) inverts output upon match between tm0n and cr01n. sets one-shot pulse output mode. 0/1 1 1 (d) prescaler mode register 0n (prm0n) 0/1 0/1 0 1 prm0n prm0n1 prm0n0 selects count clock (setting ?11? is prohibited). specifies the rising edge for pulse width detection. 0/1 0/1 es1n1 es1n0 es0n1 es0n0 setting invalid (setting ?10? is prohibited.) 00 32
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 280 cautions 1. do not set the cr00n and cr01n registers to 0000h. 2. only 16-bit timer/event counter 00 can use the one-shot pulse output with external trigger of 78k0/fc2. 3. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2 figure 7-54. timing of one-shot pulse output operation with external trigger (with rising edge specified) 0000h n nn n n mm m m m n + 1 n + 2 m + 1 m + 2 m ? 2 m ? 1 0001h 0000h count clock tm0n count value cr01n set value cr00n set value ti00n pin input inttm01n inttm00n to0n pin output when tmc0n is set to 08h (tm0n count starts) t cautions 1. 16-bit timer counter 0n starts operating as soon as a value other than 00 (operation stop mode) is set to the tmc0n2 and tmc0n3 bits. 2. only 16-bit timer/event counter 00 can use the one-shot pulse output with external trigger of 78k0/fc2. 3. selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n < m n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 281 7.5 special use of tm0n 7.5.1 rewriting cr01n during tm0n operation in principle, rewriting cr00n and cr01n of the 78k0/fx2 microcontroller when they are used as compare registers is prohibited while tm0n is operatin g (tmc0n3 and tmc0n2 = other than 00). however, the value of cr01n can be changed, even while tm0n is operating, using the fo llowing procedure if cr01n is used for ppg output and the duty factor is chang ed (when changing the value of cr01n to a smaller value than the current one, rewrite it immediately after its value matches the va lue of tm0n. when changing the value of cr01n to a larger value than the current one, rewrite it i mmediately after the values of cr00n and tm0n match. if the value of cr01n is rewritten immediately before a ma tch between cr01n and tm0n, or between cr00n and tm0n, an unexpected operation may be performed). procedure for changing value of cr01n <1> disable interrupt inttm01n (tmmk01n = 1). <2> disable reversal of the timer output when the value of tm0n matches that of cr01n (toc0n4 = 0). <3> change the value of cr01n. <4> wait for one cycle of the count clock of tm0n. <5> enable reversal of the timer output when th e value of tm0n matches that of cr01n (toc0n4 = 1). <6> clear the interrupt flag of inttm01n (tmif01n = 0) to 0. <7> enable interrupt inttm01n (tmmk01n = 0). remark for tmif01n and tmmk01n, see chapter 17 interrupt functions . 7.5.2 setting lvs0n and lvr0n (1) usage of lvs0n and lvr0n lvs0n and lvr0n are used to set the default value of t he to0n pin output and to invert the timer output without enabling the timer operation (tmc0n3 and tmc0n2 = 00). clear lvs0n and lvr0n to 00 (default value: low- level output) when software control is unnecessary. lvs0n lvr0n timer output status 0 0 not changed (low-level output) 0 1 cleared (low-level output) 1 0 set (high-level output) 1 1 setting prohibited caution selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 282 (2) setting lvs0n and lvr0n set lvs0n and lvr0n using the following procedure. figure 7-55. example of flow for setting lvs0n and lvr0n bits setting toc0n.ospe0n, toc0n4, toc0n1 bits setting toc0n.toe0n bit setting toc0n.lvs0n, lvr0n bits setting tmc0n.tmc0n3, tmc0n2 bits <3> enabling timer operation <2> setting of timer output f/f <1> setting of timer output operation caution be sure to set lvs0n and lvr0n following steps <1>, <2>, and <3> above. step <2> can be performed after <1> and before <3>. figure 7-56. timing example of lvr0n and lvs0n toc0n.lvs0n bit toc0n.lvr0n bit operable bits (tmc0n3, tmc0n2) to0n pin output inttm00n signal <1> 00 <2> <1> <3> <4> <4> <4> 01, 10, or 11 <1> the to0n pin output goes high when lvs0n and lvr0n = 10. <2> the to0n pin output goes low when lvs0n and lv r0n = 01 (the pin output remains unchanged from the high level even if lvs0n and lvr0n are cleared to 00). <3> the timer starts operating when tmc0n3 and tmc0n2 are set to 01, 10, or 11. because lvs0n and lvr0n were set to 10 before the operat ion was started, the to 0n pin output starts from the high level. after the timer starts operating, setting lvs0n and lvr0n is prohibited until tmc0n3 and tmc0n2 = 00 (disabling the timer operation). <4> the output level of the to0n pi n is inverted each time an interr upt signal (inttm00n) is generated. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 283 7.6 cautions for 16-bit timer/event counters 00 to 03 (1) restrictions for each channel of 16-bit timer/event counter 0n table 7-5 shows the restrictions for each channel. table 7-5. restrictions for each channel of 16-bit timer/event counter 0n operation restriction as interval timer as square-wave output as external event counter ? as clear & start mode entered by ti00n pin valid edge input using timer output (to0n) is prohibited when det ection of the valid edge of the ti01n pin is used. (toc0n = 00h) as free-running timer ? as ppg output 0000h cp01n < cr00n ffffh as one-shot pulse output setting the same value to cr00n and cp01n is prohibited. as pulse width measurement using timer output (to0n) is prohibited (toc0n = 00h) (2) timer start errors an error of up to one clock may occur in the time requir ed for a match signal to be generated after timer start. this is because counting tm0n is start ed asynchronously to the count pulse. figure 7-57. start timing of tm0n count 0000h timer start 0001h 0002h 0003h 0004h count pulse t m0n count value (3) setting of cr00n and cr01n (clear & start mode entered upon a match between tm0n and cr00n) set a value other than 0000h to cr00n and cr01n (tm0n c annot count one pulse when it is used as an external event counter). caution selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 284 (4) timing of holding data by capture register (a) when the valid edge is input to the ti00n/ti01n pin and the reverse phase of the ti00n pin is detected while cr00n/cr01n is read, cr01n performs a capture operation but the read value of cr00n/cr01n is not guaranteed. at this time, an interrupt signal (inttm 00n/inttm01n) is generated w hen the valid edge of the ti00n/ti01n pin is detected (the interru pt signal is not generated when the reverse-phase edge of the ti00n pin is detected). when the count value is captured because the valid edge of the ti00n/ti01n pin was detected, read the value of cr00n/cr01n after inttm00n/inttm01n is generated. figure 7-58. timing of holding data by capture register n n + 1 n + 2 x n + 1 m m + 1 m + 2 count pulse tm0n count value edge input inttm01n value captured to cr01n capture read signal capture operation is performed but read value is not guaranteed. capture operation (b) the values of cr00n and cr01n are not guarant eed after 16-bit timer/event counter 0n stops. (5) setting valid edge set the valid edge of the ti00n pin while the time r operation is stopped (tmc0n3 and tmc0n2 = 00). set the valid edge by using es0n0 and es0n1. (6) re-triggering one-shot pulse make sure that the trigger is not gener ated while an active level is being out put in the one-shot pulse output mode. be sure to input the nex t trigger after the current active level is output. caution selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 285 (7) operation of ovf0n flag (a) setting ovf0n flag (1) the ovf0n flag is set to 1 in the following case, as well as when tm0n overflows. select the clear & start mode entered upon a match between tm0n and cr00n. set cr00n to ffffh. when tm0n matches cr00n and tm0n is cleared from ffffh to 0000h figure 7-59. operation timing of ovf0n flag fffeh ffffh ffffh 0000h 0001h count pulse tm0n inttm00n ovf0n cr00n (b) clearing ovf0n flag even if the ovf0n flag is cleared to 0 after tm0n ov erflows and before the next count clock is counted (before the value of tm0n becomes 0001h), it is set to 1 again and clearing is invalid. (8) one-shot pulse output one-shot pulse output operates correct ly in the free-running timer mode or the clear & start mode entered by the ti00n pin valid edge. the one-shot pulse cannot be output in the clear & star t mode entered upon a match between tm0n and cr00n. remark n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 286 (9) capture operation (a) when valid edge of ti00n is specified as count clock when the valid edge of ti00n is specified as the count cl ock, the capture register for which ti00n is specified as a trigger does not operate correctly. (b) pulse width to accurately capture value by signals input to ti01n and ti00n pins to accurately capture the count value, the pulse input to the ti00n and ti01n pins as a capture trigger must be wider than two count clocks selected by prm0n (see figure 7-15 ). (c) generation of interrupt signal the capture operation is perfo rmed at the falling edge of the count clock but the in terrupt signals (inttm00n and inttm01n) are generated at the risi ng edge of the next count clock (see figure 7-15 ). (d) note when crc0n1 (bit 1 of capture/compare control register 0n (crc0n)) is set to 1 when the count value of the tm0n regist er is captured to the cr00n regi ster in the phase reverse to the signal input to the ti00n pin, the interrupt signal (i nttm00n) is not generated after the count value is captured. if the valid edge is det ected on the ti01n pin during this oper ation, the captur e operation is not performed but the inttm00n signal is generated as an exte rnal interrupt signal. mask the inttm00n signal when the external interrupt is not used. (10) edge detection (a) specifying valid edge after reset if the operation of the 16-bit timer/ev ent counter 0n is enabled after reset and while the ti00n or ti01n pin is at high level and when the rising edge or both the edges are specified as the valid edge of the ti00n or ti01n pin, then the high level of the ti00n or ti01n pin is detected as the rising edge. note this when the ti00n or ti01n pin is pulled up. however, the rising edge is not detected when the operation is once stopped and then enabled again. (b) sampling clock for eliminating noise the sampling clock for eliminating noise differs depend ing on whether the valid edge of ti00n is used as the count clock or capture trigger. in the fo rmer case, the sampling clock is fixed to f prs . in the latter, the count clock selected by prm0n is used for sampling. when the signal input to the ti00n pin is sampled and the valid level is detected two times in a row, the valid edge is detected. therefore, noise having a short pulse width can be eliminated (see figure 7-15 ). (11) timer operation the signal input to the ti00n/ti01n pin is not acknowle dged while the timer is stopped, regardless of the operation mode of the cpu. caution selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. remarks 1. f prs : peripheral hardware clock frequency 2. n = 0, 1: 78k0/fc2 n = 0 to 3: 78k0/fe2, 78k0/ff2
chapter 7 16-bit timer/event counters 00 to 03 user?s manual u19180ej1v0ud 287 (12) 16-bit timer/event counter 01 of 78k0/fc2 since the composition of a timer i/o pin changes with pr oducts, the 16-bit timer/event counter 01 has the difference of function in a 16-bir timer/event counter00. the difference in the function by the product is shown below. product pin pd78f0881a, 78f0882a and 78f0883a pd78f0884a, 78f0885a, 78f0886a, 78f0894a and 78f0895a ti001 ? ? ti011 ? provided to01 ? provided be careful to the following restrictions for function of 16-bit timer/event counter 01 for pd78f0881a, 78f0882a and 78f0883a. ? selecting ti001 and ti011 for count clock is prohibited. wh en using ti001 for baud rate error calculation, it is not applicable. ? timer output is prohibited. be careful to the following restrictions fo r function of 16-bit timer/event counter 01 for pd78f0884a, 78f0885a, 78f0886a, 78f0894a and 78f0895a. ? selecting ti001 for count clock is prohibited. when us ing ti001 for baud rate error calculation, it is not applicable.
user?s manual u19180ej1v0ud 288 chapter 8 8-bit timer/even t counters 50 and 51 8.1 functions of 8-bit timer/event counters 50 and 51 8-bit timer/event counters 50 and 51 are mounted onto all 78k0/fx2 microcontroller products. 8-bit timer/event counters 50 and 51 have the following functions. ? interval timer ? external event counter ? square-wave output ? pwm output figures 8-1 and 8-2 show the block diagram s of 8-bit timer/event counters 50 and 51. figure 8-1. block diagram of 8-bit timer/event counter 50 internal bus 8-bit timer compare register 50 (cr50) ti50/to50/ p17 f prs /2 2 f prs /2 6 f prs /2 8 f prs /2 13 f prs f prs /2 match mask circuit ovf clear 3 selector tcl502 tcl501 tcl500 timer clock selection register 50 (tcl50) internal bus tce50 tmc506 lvs50 lvr50 tmc501 toe50 invert level 8-bit timer mode control register 50 (tmc50) s r s q r inv selector to tmh0 to uart0 to uart6 inttm50 to50/ti50/ p17 note 1 note 2 selector 8-bit timer counter 50 (tm50) selector output latch (p17) pm17 notes 1. timer output f/f 2. pwm output f/f
chapter 8 8-bit timer/event counters 50 and 51 user?s manual u19180ej1v0ud 289 figure 8-2. block diagram of 8-bit timer/event counter 51 internal bus 8-bit timer compare register 51 (cr51) ti51/to51/p33/intp4 f prs /2 8 f prs /2 12 f prs f prs /2 match mask circuit ovf clear 3 selector tcl512 tcl511 tcl510 timer clock selection register 51 (tcl51) internal bus tce51 tmc516 lvs51 lvr51 tmc511 toe51 invert level 8-bit timer mode control register 51 (tmc51) s r s q r inv selector inttm51 to51/ti51/ p33/intp4 note 1 note 2 selector 8-bit timer counter 51 (tm51) selector output latch (p33) pm33 f prs /2 6 f prs /2 4 notes 1. timer output f/f 2. pwm output f/f
chapter 8 8-bit timer/event counters 50 and 51 user?s manual u19180ej1v0ud 290 8.2 configuration of 8-bit timer/event counters 50 and 51 8-bit timer/event counters 50 and 51 include the following hardware. table 8-1. configuration of 8-bit timer/event counters 50 and 51 item configuration timer register 8-bit timer counter 5n (tm5n) register 8-bit timer compare register 5n (cr5n) timer input ti5n timer output to5n control registers timer clock selection register 5n (tcl5n) 8-bit timer mode control register 5n (tmc5n) port mode register 1 (pm1) or port mode register 3 (pm3) port register 1 (p1) or port register 3 (p3) (1) 8-bit timer counter 5n (tm5n) tm5n is an 8-bit register that count s the count pulses and is read-only. the counter is incremented in synchronization with the risi ng edge of the count clock. figure 8-3. format of 8-bit timer counter 5n (tm5n) symbol tm5n ( n = 0, 1) a ddress: ff16h (tm50), ff1fh (tm51) after reset: 00h r in the following situations, the count value is cleared to 00h. <1> reset signal generation <2> when tce5n is cleared <3> when tm5n and cr5n match in the mode in which cl ear & start occurs upon a match of the tm5n and cr5n. remark n = 0, 1
chapter 8 8-bit timer/event counters 50 and 51 user?s manual u19180ej1v0ud 291 (2) 8-bit timer compare register 5n (cr5n) cr5n can be read and written by an 8-bit memory manipulation instruction. except in pwm mode, the value set in cr5n is constantly compared with t he 8-bit timer counter 5n (tm5n) count value, and an interrupt request (int tm5n) is generated if they match. in pwm mode, when the to5n pin becomes active due to a tm5n overflow and the values of tm5n and cr5n match, the to5n pin becomes inactive. the value of cr5n can be set within 00h to ffh. reset signal generation clears cr5n to 00h. figure 8-4. format of 8-bit timer compare register 5n (cr5n) symbol cr5n (n = 0, 1) address: ff17h (cr50), ff41h (cr51) after reset: 00h r/w cautions 1. in the mode in which clear & start o ccurs on a match of tm5n and cr5n (tmc5n6 = 0), do not write other values to cr5n during operation. 2. in pwm mode, make the cr5n rewrite pe riod 3 count clocks of the count clock (clock selected by tcl5n) or more. remark n = 0, 1
chapter 8 8-bit timer/event counters 50 and 51 user?s manual u19180ej1v0ud 292 8.3 registers controlling 8-bit timer/event counters 50 and 51 the following four registers are used to co ntrol 8-bit timer/event counters 50 and 51. ? timer clock selection register 5n (tcl5n) ? 8-bit timer mode control register 5n (tmc5n) ? port mode register 1 (pm1) or port mode register 3 (pm3) ? port register 1 (p1) or port register 3 (p3)
chapter 8 8-bit timer/event counters 50 and 51 user?s manual u19180ej1v0ud 293 (1) timer clock selection register 5n (tcl5n) this register sets the count clock of 8-bit timer/ev ent counter 5n and the valid edge of the ti5n pin input. tcl5n can be set by an 8-bit memory manipulation instruction. reset signal generation clears tcl5n to 00h. remark n = 0, 1 figure 8-5. format of timer clo ck selection register 50 (tcl50) address: ff6ah after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 tcl50 0 0 0 0 0 tcl502 tcl501 tcl500 count clock selection note 1 tcl502 tcl501 tcl500 f prs = 4 mhz f prs = 8 mhz f prs = 10 mhz f prs = 20 mhz 0 0 0 ti50 pin falling edge note 2 0 0 1 ti50 pin rising edge note 3 0 1 0 f prs note 4 4 mhz 8 mhz 10 mhz note 5 20 mhz note 6 0 1 1 f prs /2 2 mhz 4 mhz 5 mhz 10 mhz note 5 1 0 0 f prs /2 2 1 mhz 2 mhz 2.5 mhz 5 mhz 1 0 1 f prs /2 6 62.5 khz 125 khz 156.25 khz 312.5 khz 1 1 0 f prs /2 8 15.62 khz 31.25 khz 39.06 khz 78.13 khz 1 1 1 f prs /2 13 0.48 khz 0.97 khz 1.22 khz 2.44 khz notes 1. the frequency that can be used for the peripheral hardware clock (f prs ) differs depending on the power supply voltage and produc t specifications. supply voltage peripheral hardware clock frequency 4.0 v v dd 5.5 v f prs 20 mhz 2.7 v v dd < 4.0 v f prs 10 mhz 1.8 v v dd < 2.7 v ((a) grade products only) f prs 5 mhz (the values shown in the table above are those when f prs = f xh (xsel = 1).) 2. in the on-board mode, the flmd 0 pin falling edge is selected. 3. in the on-board mode, the flmd 0 pin rising edge is selected. 4. if the peripheral hardware clock (f prs ) operates on the internal high-speed oscillation clock (f rh ) (xsel = 0), when 1.8 v v dd < 2.7 v, the setting of tcl502, tcl501, tcl500 = 0, 1, 0 (count clock: f prs ) is prohibited. 5. this is settable only if 2.7 v v dd 5.5 v. 6. this is settable only if 4.0 v v dd 5.5 v. cautions 1. when rewriting tcl50 to other data, stop the timer operation beforehand. 2. be sure to set bits 3 to 7 to 0. remark f prs : peripheral hardware clock frequency
chapter 8 8-bit timer/event counters 50 and 51 user?s manual u19180ej1v0ud 294 figure 8-6. format of timer clock selection register 51 (tcl51) address: ff8ch after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 tcl51 0 0 0 0 0 tcl512 tcl511 tcl510 count clock selection note 1 tcl512 tcl511 tcl510 f prs = 4 mhz f prs = 8 mhz f prs = 10 mhz f prs = 20 mhz 0 0 0 ti51 pin falling edge 0 0 1 ti51 pin rising edge 0 1 0 f prs note 2 4 mhz 8 mhz 10 mhz note 3 20 mhz note 4 0 1 1 f prs /2 2 mhz 4 mhz 5 mhz 10 mhz note 3 1 0 0 f prs /2 4 250 khz 500 khz 625 khz 1.25 mhz 1 0 1 f prs /2 6 62.5 khz 125 khz 156.25 khz 312.5 khz 1 1 0 f prs /2 8 15.62 khz 31.25 khz 39.06 khz 78.13 khz 1 1 1 f prs /2 12 0.97 khz 1.95 khz 2.44 khz 4.88 khz notes 1. the frequency that can be used for the peripheral hardware clock (f prs ) differs depending on the power supply voltage and produc t specifications. supply voltage peripheral hardware clock frequency 4.0 v v dd 5.5 v f prs 20 mhz 2.7 v v dd < 4.0 v f prs 10 mhz 1.8 v v dd < 2.7 v ((a) grade products only) f prs 5 mhz (the values shown in the table above are those when f prs = f xh (xsel = 1).) 2. if the peripheral hardware clock (f prs ) operates on the internal high-speed oscillation clock (f rh ) (xsel = 0), when 1.8 v v dd < 2.7 v, the setting of tcl512, tcl511, tcl510 = 0, 1, 0 (count clock: f prs ) is prohibited. 3. this is settable only if 2.7 v v dd 5.5 v. 4. this is settable only if 4.0 v v dd 5.5 v. cautions 1. when rewriting tcl51 to other data, stop the timer operation beforehand. 2. be sure to set bits 3 to 7 to 0. remark f prs : peripheral hardware clock frequency
chapter 8 8-bit timer/event counters 50 and 51 user?s manual u19180ej1v0ud 295 (2) 8-bit timer mode control register 5n (tmc5n) tmc5n is a register that performs the following five types of settings. <1> 8-bit timer counter 5n (tm5n) count operation control <2> 8-bit timer counter 5n (tm5n) operating mode selection <3> timer output f/f (flip flop) status setting <4> active level selection in timer f/f control or pwm (free-running) mode <5> timer output control tmc5n can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears this register to 00h. remark n = 0, 1 figure 8-7. format of 8-bit timer mode control register 50 (tmc50) address: ff6bh after reset: 00h r/w note symbol <7> 6 5 4 <3> <2> 1 <0> tmc50 tce50 tmc506 0 0 lvs50 lvr50 tmc501 toe50 tce50 tm50 count operation control 0 after clearing to 0, count operation disabled (counter stopped) 1 count operation start tmc506 tm50 operating mode selection 0 mode in which clear & start occurs on a match between tm50 and cr50 1 pwm (free-running) mode lvs50 lvr50 timer output f/f status setting 0 0 no change 0 1 timer output f/f clear (0) (default value of to50 output: low level) 1 0 timer output f/f set (1) (default value of to50 output: high level) 1 1 setting prohibited in other modes (tmc506 = 0) in pwm mode (tmc506 = 1) tmc501 timer f/f control active level selection 0 inversion operation disabled active-high 1 inversion operation enabled active-low toe50 timer output control 0 output disabled (tm50 output is low level) 1 output enabled note bits 2 and 3 are write-only. (refer to cautions and remarks on the next page.)
chapter 8 8-bit timer/event counters 50 and 51 user?s manual u19180ej1v0ud 296 figure 8-8. format of 8-bit timer mode control register 51 (tmc51) address: ff43h after reset: 00h r/w note symbol <7> 6 5 4 <3> <2> 1 <0> tmc51 tce51 tmc516 0 0 lvs51 lvr51 tmc511 toe51 tce51 tm51 count operation control 0 after clearing to 0, count operation disabled (counter stopped) 1 count operation start tmc516 tm51 operating mode selection 0 mode in which clear & start occurs on a match between tm51 and cr51 1 pwm (free-running) mode lvs51 lvr51 timer output f/f status setting 0 0 no change 0 1 timer output f/f clear (0) (default value of to51 output: low) 1 0 timer output f/f set (1) (default value of to51 output: high) 1 1 setting prohibited in other modes (tmc516 = 0) in pwm mode (tmc516 = 1) tmc511 timer f/f control active level selection 0 inversion operation disabled active-high 1 inversion operation enabled active-low toe51 timer output control 0 output disabled (tm51 output is low level) 1 output enabled note bits 2 and 3 are write-only. cautions 1. the settings of lvs5n and lvr5n are valid in other than pwm mode. 2. perform <1> to <4> below in the following order, not at the same time. <1> set tmc5n1, tmc5n6: operation mode setting <2> set toe5n to enable output: timer output enable <3> set lvs5n, lvr5n (see caution 1): timer f/f setting <4> set tce5n 3. stop operation before rewriting tmc5n6. remarks 1. in pwm mode, pwm output is made inactive by clearing tce5n to 0. 2. if lvs5n and lvr5n are read, the value is 0. 3. the values of the tmc5n6, lvs 5n, lvr5n, tmc5n1, and toe5n bits are reflected at the to5n pin regardless of the value of tce5n. 4. n = 0, 1
chapter 8 8-bit timer/event counters 50 and 51 user?s manual u19180ej1v0ud 297 (3) port mode registers 1 and 3 (pm1, pm3) these registers set port 1 and 3 input/output in 1-bit units. when using the p17/to50/ti50 and p33/to51/ti51/intp4 pins for timer output, clear pm17 and pm33 and the output latches of p17 and p33 to 0. when using the p17/to50/ti50 and p33/to51/ti51/intp4 pins for timer input, set pm17 and pm33 to 1. the output latches of p17 and p33 at this time may be 0 or 1. pm1 and pm3 can be set by a 1-bit or 8- bit memory manipulation instruction. reset signal generation sets these registers to ffh. figure 8-9. format of port mode register 1 (pm1) address: ff21h after reset: ffh r/w symbol 7 6 5 4 3 2 1 0 pm1 pm17 pm16 pm15 pm14 pm13 pm12 pm11 pm10 pm1n p1n pin i/o mode selection (n = 0 to 7) 0 output mode (output buffer on) 1 input mode (output buffer off) figure 8-10. format of port mode register 3 (pm3) address: ff23h after reset: ffh r/w symbol 7 6 5 4 3 2 1 0 pm3 1 1 1 1 pm33 pm32 pm31 pm30 pm3n p3n pin i/o mode selection (n = 0 to 3) 0 output mode (output buffer on) 1 input mode (output buffer off)
chapter 8 8-bit timer/event counters 50 and 51 user?s manual u19180ej1v0ud 298 8.4 operations of 8-bit timer/event counters 50 and 51 8.4.1 operation as interval timer 8-bit timer/event counter 5n operates as an interval timer that generates interrupt req uests repeatedly at intervals of the count value preset to 8-bi t timer compare register 5n (cr5n). when the count value of 8-bit timer counter 5n (tm5n) ma tches the value set to cr5n, counting continues with the tm5n value cleared to 0 and an interrupt request signal (inttm5n) is generated. the count clock of tm5n can be selected with bits 0 to 2 (tcl5n0 to tcl5n2) of timer clock selection register 5n (tcl5n). setting <1> set the registers. ? tcl5n: select the count clock. ? cr5n: compare value ? tmc5n: stop the count operation, se lect the mode in which clear & start occurs on a match of tm5n and cr5n. (tmc5n = 0000 0b = don?t care) <2> after tce5n = 1 is set, the count operation starts. <3> if the values of tm5n and cr5n match, inttm5n is generated (tm5n is cleared to 00h). <4> inttm5n is generated repeatedly at the same interval. set tce5n to 0 to stop the count operation. caution do not write other values to cr5n during operation. figure 8-11. interval timer operation timing (1/2) (a) basic operation t count clock t m5n count value cr5n tce5n inttm5n count start clear clear 00h 01h n 00h 01h n 00h 01h n n n n n interrupt acknowledged interrupt acknowledged interval time interval time remark interval time = (n + 1) t n = 00h to ffh n = 0, 1
chapter 8 8-bit timer/event counters 50 and 51 user?s manual u19180ej1v0ud 299 figure 8-11. interval timer operation timing (2/2) (b) when cr5n = 00h t interval time count clock tm5n cr5n tce5n inttm5n 00h 00h 00h 00h 00h (c) when cr5n = ffh t count clock tm5n cr5n tce5n inttm5n 01 fe ff 00 fe ff 00 ff ff ff interval time interrupt acknowledged interrupt acknowledged remark n = 0, 1
chapter 8 8-bit timer/event counters 50 and 51 user?s manual u19180ej1v0ud 300 8.4.2 operation as external event counter the external event counter c ounts the number of external clock pulses to be input to the ti5n pin by 8-bit timer counter 5n (tm5n). tm5n is incremented each time the vali d edge specified by timer clock selection register 5n (tcl5n) is input. either the rising or falling edge can be selected. when the tm5n count value matches the va lue of 8-bit timer compare register 5n (cr5n), tm5n is cleared to 0 and an interrupt request signal (inttm5n) is generated. whenever the tm5n value matches the va lue of cr5n, inttm5n is generated. setting <1> set each register. ? set the port mode register (pm17 or pm33) note to 1. ? tcl5n: select ti5n pin input edge. ti5n pin falling edge tcl5n = 00h ti5n pin rising edge tcl5n = 01h ? cr5n: compare value ? tmc5n: stop the count operation, se lect the mode in which clear & start occurs on match of tm5n and cr5n, disable the timer f/f inversion operation, disable timer output. (tmc5n = 0000 00b = don?t care) <2> when tce5n = 1 is set, the number of pu lses input from the ti5n pin is counted. <3> when the values of tm5n and cr5n match, inttm5n is generated (tm5n is cleared to 00h). <4> after these settings, inttm5n is generated ea ch time the values of tm5n and cr5n match. note 8-bit timer/event counter 50: pm17 8-bit timer/event counter 51: pm33 figure 8-12. external event counter operation timing (with rising edge specified) ti5n tm5n count value cr5n inttm5n 00 01 02 03 04 05 n ?1 n 00 01 02 03 n count start remark n = 00h to ffh n = 0, 1
chapter 8 8-bit timer/event counters 50 and 51 user?s manual u19180ej1v0ud 301 8.4.3 square-wave output operation a square wave with any selected frequency is output at in tervals determined by the value preset to 8-bit timer compare register 5n (cr5n). the to5n pin output status is inverted at intervals determined by the count value preset to cr5n by setting bit 0 (toe5n) of 8-bit timer mode control regi ster 5n (tmc5n) to 1. this enables a square wave with any selected frequency to be output (duty = 50%). setting <1> set each register. ? clear the port output latch (p17 or p33) note and port mode register (pm17 or pm33) note to 0. ? tcl5n: select the count clock. ? cr5n: compare value ? tmc5n: stop the count operat ion, select the mode in which clear & start occurs on a match of tm5n and cr5n. lvs5n lvr5n timer output f/f status setting 1 0 high-level output 0 1 low-level output timer output f/f inversion enabled timer output enabled (tmc5n = 00001011b or 00000111b) <2> after tce5n = 1 is set, the count operation starts. <3> the timer output f/f is inverted by a match of tm5n and cr5n. after inttm5n is generated, tm5n is cleared to 00h. <4> after these settings, the timer output f/f is inverted at the same interval and a square wave is output from to5n. the frequency is as follows. frequency = 1/2t (n + 1) (n: 00h to ffh) note 8-bit timer/event counter 50: p17, pm17 8-bit timer/event counter 51: p33, pm33 caution do not write other values to cr5n during operation. remark n = 0, 1
chapter 8 8-bit timer/event counters 50 and 51 user?s manual u19180ej1v0ud 302 figure 8-13. square-wave output operation timing count clock tm5n count value 00h 01h 02h n ? 1n n 00h n ? 1 n 00h 01h 02h cr5n to5n note t count start note the initial value of to5n output can be set by bits 2 and 3 (lvr5n, lvs5n) of 8-bit timer mode control register 5n (tmc5n). 8.4.4 pwm output operation 8-bit timer/event counter 5n operates as a pwm output when bit 6 (tmc5n6) of 8-bit timer mode control register 5n (tmc5n) is set to 1. the duty pulse determined by the value set to 8-bit time r compare register 5n (cr5n) is output from to5n. set the active level width of the pwm pulse to cr5n; the active level can be selected with bit 1 (tmc5n1) of tmc5n. the count clock can be selected with bits 0 to 2 (tcl5n0 to tcl5n2) of timer clock selection register 5n (tcl5n). pwm output can be enabled/disabled with bit 0 (toe5n) of tmc5n. caution in pwm mode, make the cr5n rewrite period 3 count clocks of the count clock (clock selected by tcl5n) or more. remark n = 0, 1
chapter 8 8-bit timer/event counters 50 and 51 user?s manual u19180ej1v0ud 303 (1) pwm output basic operation setting <1> set each register. ? clear the port output latch (p17 or p33) note and port mode register (pm17 or pm33) note to 0. ? tcl5n: select the count clock. ? cr5n: compare value ? tmc5n: stop the count operation, select pwm mode. the timer output f/f is not changed. tmc5n1 active level selection 0 active-high 1 active-low timer output enabled (tmc5n = 01000001b or 01000011b) <2> the count operation starts when tce5n = 1. clear tce5n to 0 to st op the count operation. note 8-bit timer/event counter 50: p17, pm17 8-bit timer/event counter 51: p33, pm33 pwm output operation <1> pwm output (output from to5n) outputs an inactive level until an overflow occurs. <2> when an overflow occurs, the active level is outpu t. the active level is output until cr5n matches the count value of 8-bit timer counter 5n (tm5n). <3> after the cr5n matches the count value, the inacti ve level is output until an overflow occurs again. <4> operations <2> and <3> are repe ated until the count operation stops. <5> when the count operation is stopped with tce5n = 0, pwm output becomes inactive. for details of timing, see figures 8-14 and 8-15 . the cycle, active-level width, and duty are as follows. ? cycle = 2 8 t ? active-level width = nt ? duty = n/2 8 (n = 00h to ffh) remark n = 0, 1
chapter 8 8-bit timer/event counters 50 and 51 user?s manual u19180ej1v0ud 304 figure 8-14. pwm output operation timing (a) basic operation (active level = h) c ount clock tm5n cr5n tce5n inttm5n to5n 00h 01h ffh 00h 01h 02h n n + 1 ffh 00h 01h 02h m 00h n <2> active level <1> <3> inactive level active level <5> t (b) cr5n = 00h count clock tm5n cr5n tce5n inttm5n to5n inactive level inactive level 01h 00h ffh 00h 01h 02h n n + 1 ffh 00h 01h 02h m 00h 00h n + 2 l t (c) cr5n = ffh tm5n cr5n tce5n inttm5n to5n 01h 00h ffh 00h 01h 02h n n + 1 ffh 00h 01h 02h m 00h ffh n + 2 inactive level active level inactive level active level inactive level t remarks 1. <1> to <3> and <5> in figure 8-14 (a) correspond to <1> to <3> and <5> in pwm output operation in 8. 4. 4 (1) pwm output basic operation . 2. n = 0, 1
chapter 8 8-bit timer/event counters 50 and 51 user?s manual u19180ej1v0ud 305 (2) operation with cr5n changed figure 8-15. timing of operation with cr5n changed (a) cr5n value is changed from n to m before clock rising edge of ffh value is transferred to cr5n at overflow immediately after change. c ount clock tm5n cr5n tce5n i nttm5n to5n <1> cr5n change (n m) n n + 1 n + 2 ffh 00h 01h m m + 1 m + 2 ffh 00h 01h 02h m m + 1 m + 2 n 02h m h <2> t (b) cr5n value is changed from n to m after clock rising edge of ffh value is transferred to cr5n at second overflow. count clock tm5n cr5n tce5n inttm5n to5n n n + 1 n + 2 ffh 00h 01h n n + 1 n + 2 ffh 00h 01h 02h n 02h n h m m m + 1 m + 2 <1> cr5n change (n m) <2> t caution when reading from cr5n between <1> and <2> in figure 8-15, the value read differs from the actual value (read value: m, actual value of cr5n: n).
chapter 8 8-bit timer/event counters 50 and 51 user?s manual u19180ej1v0ud 306 8.5 cautions for 8-bit timer/event counters 50 and 51 (1) timer start error an error of up to one clock may occur in the time requir ed for a match signal to be generated after timer start. this is because 8-bit timer counters 50 and 51 (tm50, tm 51) are started asynchronously to the count clock. figure 8-16. 8-bit timer counter 5n start timing count clock tm5n count value 00h 01h 02h 03h 04h timer start remark n = 0, 1
user?s manual u19180ej1v0ud 307 chapter 9 8-bit timers h0 and h1 9.1 functions of 8-bit timers h0 and h1 8-bit timers h0 and h1 are mounted onto all 78k0/fx2 microcontroller products. 8-bit timers h0 and h1 have the following functions. ? interval timer ? pwm output mode ? square-wave output ? carrier generator mode (8-bit timer h1 only) 9.2 configuration of 8-bit timers h0 and h1 8-bit timers h0 and h1 include the following hardware. table 9-1. configuration of 8-bit timers h0 and h1 item configuration timer register 8-bit timer counter hn registers 8-bit timer h compare register 0n (cmp0n) 8-bit timer h compare register 1n (cmp1n) timer output tohn control registers 8-bit timer h mode register n (tmhmdn) 8-bit timer h carrier control register 1 (tmcyc1) note port mode register 1 (pm1) port register 1 (p1) note 8-bit timer h1 only remark n = 0, 1 figures 9-1 and 9-2 show the block diagrams.
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 308 figure 9-1. block diagram of 8-bit timer h0 tmhe0 cks02 cks01 cks00 tmmd01 tmmd00 tolev0 toen0 toh0/p15 inttmh0 f prs f prs /2 f prs /2 2 f prs /2 6 f prs /2 10 1 0 f/f r 3 2 pm15 match internal bus 8-bit timer h mode register 0 (tmhmd0) 8-bit timer h compare register 10 (cmp10) decoder selector interrupt generator output controller level inversion pwm mode signal timer h enable signal clear 8-bit timer h compare register 00 (cmp00) output latch (p15) 8-bit timer/ event counter 50 output selector 8-bit timer counter h0
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 309 figure 9-2. block diagram of 8-bit timer h1 match internal bus tmhe1 cks12 cks11 cks10 tmmd11 tmmd10 tolev1 toen1 8-bit timer h compare register 1 1 (cmp11) decoder toh1/ intp5/ p16 8-bit timer h carrier control register 1 (tmcyc1) inttmh1 inttm51 selector f prs f prs /2 2 f prs /2 4 f prs /2 6 f prs /2 12 f rl f rl /2 7 f rl /2 9 interrupt generator output controller level inversion pm16 output latch (p16) 1 0 f/f r pwm mode signal carrier generator mode signal timer h enable signal 3 2 8-bit timer h compare register 0 1 (cmp01) 8-bit timer counter h1 clear rmc1 nrzb1 nrz1 reload/ interrupt control 8-bit timer h mode register 1 (tmhmd1) selector
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 310 (1) 8-bit timer h compare register 0n (cmp0n) this register can be read or written by an 8-bit memory mani pulation instruction. this r egister is used in all of the timer operation modes. this register constantly comp ares the value set to cmp0n with the count value of the 8-bit timer counter hn and, when the two values match, generates an interrupt request signal (inttm hn) and inverts the output level of tohn. rewrite the value of cmp0n while the timer is stopped (tmhen = 0). a reset signal generation clears this register to 00h. figure 9-3. format of 8-bit timer h compare register 0n (cmp0n) symbol cmp0n (n = 0, 1) address: ff02h (cmp00), ff1ah (cmp01) after reset: 00h r/w 7 6 5 4 32 1 0 caution cmp0n cannot be rewritten during timer count operation. cmp0n can be refreshed (the same value is written) during timer count operation. (2) 8-bit timer h compare register 1n (cmp1n) this register can be read or written by an 8-bit memory manipulation instruction. th is register is used in the pwm output mode and carrier generator mode. in the pwm output mode, this register constantly compares the value set to cmp1n with the count value of the 8- bit timer counter hn and, when the two values match, in verts the output level of tohn. no interrupt request signal is generated. in the carrier generator mode, the cmp 1n register always compares the val ue set to cmp1n with the count value of the 8-bit timer counter hn and, wh en the two values match, generates an in terrupt request signal (inttmhn). at the same time, the count value is cleared. cmp1n can be refreshed (the same value is writte n) and rewritten during timer count operation. if the value of cmp1n is rewritten while the timer is oper ating, the new value is la tched and transferred to cmp1n when the count value of the timer matches the old val ue of cmp1n, and then the valu e of cmp1n is changed to the new value. if matching of the count value and the cmp1n value and wr iting a value to cmp1n conflict, the value of cmp1n is not changed. a reset signal generation clears this register to 00h. figure 9-4. format of 8-bit timer h compare register 1n (cmp1n) symbol cmp1n (n = 0, 1) address: ff0eh (cmp10), ff1bh (cmp11) after reset: 00h r/w 7 6 5 4 32 1 0 caution in the pwm output mode and carrier generator mode, be sure to set cmp1n when starting the timer count operation (tmhen = 1) after the timer count operation was stopped (tmhen = 0) (be sure to set again even if setting the same value to cmp1n). remark n = 0, 1
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 311 9.3 registers controlling 8-bit timers h0 and h1 the following four registers are used to control 8-bit timers h0 and h1. ? 8-bit timer h mode register n (tmhmdn) ? 8-bit timer h carrier control register 1 (tmcyc1) note ? port mode register 1 (pm1) ? port register 1 (p1) note 8-bit timer h1 only (1) 8-bit timer h mode register n (tmhmdn) this register controls the mode of timer h. this register can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears this register to 00h. remark n = 0, 1
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 312 figure 9-5. format of 8-bit timer h mode register 0 (tmhmd0) address: ff69h after reset: 00h r/w symbol <7> 6 5 4 3 2 <1> <0> tmhmd0 tmhe0 cks02 cks01 cks00 tmmd01 tmmd00 tolev0 toen0 tmhe0 timer operation enable 0 stops timer count operation (counter is cleared to 0) 1 enables timer count operation (count oper ation started by inputting clock) count clock selection note 1 cks02 cks01 cks00 f prs = 4 mhz f prs = 8 mhz f prs = 10 mhz f prs = 20 mhz 0 0 0 f prs note 2 4 mhz 8 mhz 10 mhz note 3 20 mhz note 4 0 0 1 f prs /2 2 mhz 4 mhz 5 mhz 10 mhz note 3 0 1 0 f prs /2 2 1 mhz 2 mhz 2.5 mhz 5 mhz 0 1 1 f prs /2 6 62.5 khz 125 khz 156.25 khz 312.5 khz 1 0 0 f prs /2 10 3.90 khz 7.81 khz 9.77 khz 19.54 khz 1 0 1 tm50 output note 5 other than above setting prohibited tmmd01 tmmd00 timer operation mode 0 0 interval timer mode 1 0 pwm output mode other than above setting prohibited tolev0 timer output level control (in default mode) 0 low level 1 high level toen0 timer output control 0 disables output 1 enables output notes 1. the frequency that can be used for the peripheral hardware clock (f prs ) differs depending on the power supply voltage and product specifications. supply voltage peripheral hardware clock frequency 4.0 v v dd 5.5 v f prs 20 mhz 2.7 v v dd < 4.0 v f prs 10 mhz 1.8 v v dd < 2.7 v ( (a) grade products only) f prs 5 mhz (the values shown in the table above are those when f prs = f xh (xsel = 1).)
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 313 notes 2. if the peripheral hardware clock (f prs ) operates on the internal high-speed oscillation clock (f rh ) (xsel = 0), when 1.8 v v dd < 2.7 v, the setting of cks02 = cks01 = cks00 = 0 (count clock: f prs ) is prohibited. 3. this is settable only if 2.7 v v dd 5.5 v. 4. this is settable only if 4.0 v v dd 5.5 v. 5. when tm50 output as the count clock. ? set to pwm mode (tmc506 = 1) after the following order to bellow. <1>set the count clock to make the duty = 50%. <2>start the operation of 8- bit timer/event counter 50. ? set to mode in which the count clock is cleared and started upon a match of tm50 and cr50 (tmc506 = 0) after the following order to bellow. <1>enable the timer f/f inversion operation (tmc501 = 1). <2>start the operation of 8- bit timer/event counter 50. it is not necessary to enable the to50 pin as a timer output pin in any mode. cautions 1. when tmhe0 = 1, setting the other bits of tmhmd0 is prohibited. however, tmhmd0 can be refreshed (the same value is written). 2. in the pwm output mode, be sure to set 8-bit timer h compare register 10 (cmp10) when starting the timer count operation (tmhe0 = 1) after the timer count operation was stopped (tmhe0 = 0) (be sure to set again even if setting the same value to cmp10). remarks 1. f prs : peripheral hardware clock frequency 2. tmc506: bit 6 of 8-bit timer mode control register 50 (tmc50) tmc501: bit 1 of tmc50
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 314 figure 9-6. format of 8-bit timer h mode register 1 (tmhmd1) address: fffah after reset: 00h r/w symbol <7> 6 5 4 3 2 <1> <0> tmhmd1 tmhe1 cks12 cks11 cks10 tmmd11 tmmd10 tolev1 toen1 tmhe1 timer operation enable 0 stops timer count operation (counter is cleared to 0) 1 enables timer count operation (count oper ation started by inputting clock) count clock selection note 1 cks12 cks11 cks10 f prs = 4 mhz f prs = 8 mhz f prs = 10 mhz f prs = 20 mhz 0 0 0 f prs note 2 4 mhz 8 mhz 10 mhz note 3 20 mhz note 4 0 0 1 f prs /2 2 1 mhz 2 mhz 2.5 mhz 5 mhz 0 1 0 f prs /2 4 250 khz 500 khz 625 khz 1.25 mhz 0 1 1 f prs /2 6 62.5 khz 125 khz 156.25 khz 312.5 khz 1 0 0 f prs /2 12 0.97 khz 1.95 khz 2.44 khz 4.88 khz 1 0 1 f rl /2 7 1.88 khz (typ.) 1 1 0 f rl /2 9 0.47 khz (typ.) 1 1 1 f rl 240 khz (typ.) tmmd11 tmmd10 timer operation mode 0 0 interval timer mode 0 1 carrier generator mode 1 0 pwm output mode 1 1 setting prohibited tolev1 timer output level control (in default mode) 0 low level 1 high level toen1 timer output control 0 disables output 1 enables output notes 1. the frequency that can be used for the peripheral hardware clock (f prs ) differs depending on the power supply voltage and product specifications. supply voltage peripheral hardware clock frequency 4.0 v v dd 5.5 v f prs 20 mhz 2.7 v v dd < 4.0 v f prs 10 mhz 1.8 v v dd < 2.7 v ((a) grade products only) f prs 5 mhz (the values shown in the table above are those when f prs = f xh (xsel = 1).)
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 315 notes 2. if the peripheral hardware clock (f prs ) operates on the internal high-speed oscillation clock (f rh ) (xsel = 0), when 1.8 v v dd < 2.7 v, the setting of cks12 = cks11 = cks10 = 0 (count clock: f prs ) is prohibited. 3. this is settable only if 2.7 v v dd 5.5 v. 3. this is settable only if 4.0 v v dd 5.5 v. cautions 1. when tmhe1 = 1, setting the other bits of tmhmd1 is prohibited. however, tmhmd1 can be refreshed (the same value is written). 2. in the pwm output mode and carrier generator mode, be sure to set 8-bit timer h compare register 11 (cmp11) when starting the timer count operation (tmhe1 = 1) after the timer count operation was stopped (tmhe1 = 0) (be sure to set again even if setting the same value to cmp11). 3. when the carrier generator mode is used, set so that the count clock frequency of tmh1 becomes more than 6 times the count clock frequency of tm51. remarks 1. f prs : peripheral hardware clock frequency 2. f rl : internal low-speed oscillation clock frequency (2) 8-bit timer h carrier control register 1 (tmcyc1) this register controls the remote control output and carrier pulse output status of 8-bit timer h1. this register can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears this register to 00h. figure 9-7. format of 8-bit timer h carrier control register 1 (tmcyc1) 0 tmcyc1 0 0 0 0 rmc1 nrzb1 nrz1 address: ffeeh after reset: 00h r/w note low-level output high-level output at rising edge of inttm51 signal input low-level output carrier pulse output at rising edge of inttm51 signal input rmc1 0 0 1 1 nrzb1 0 1 0 1 remote control output carrier output disabled status (low-level status) carrier output enabled status (rmc1 = 1: carrier pulse output, rmc1 = 0: high-level status) nrz1 0 1 carrier pulse output status flag <0> note bit 0 is read-only. caution do not rewrite rmc1 when tmhe = 1. however, tmcyc1 can be refreshed (the same value is written).
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 316 (3) port mode register 1 (pm1) this register sets port 1 input/output in 1-bit units. when using the p15/toh0 and p16/toh1/intp5 pins for timer output, clear pm15 and pm16 and the output latches of p15 and p16 to 0. pm1 can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation sets this register to ffh. figure 9-8. format of port mode register 1 (pm1) address: ff21h after reset: ffh r/w symbol 7 6 5 4 3 2 1 0 pm1 pm17 pm16 pm15 pm14 pm13 pm12 pm11 pm10 pm1n p1n pin i/o mode selection (n = 0 to 7) 0 output mode (output buffer on) 1 input mode (output buffer off)
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 317 9.4 operation of 8-bit timers h0 and h1 9.4.1 operation as interval timer/square-wave output when 8-bit timer counter hn and compare register 0n (cmp0n) match, an interrupt request signal (inttmhn) is generated and 8-bit timer counter hn is cleared to 00h. compare register 1n (cmp1n) is not used in interval time r mode. since a match of 8-bit timer counter hn and the cmp1n register is not detected ev en if the cmp1n register is se t, timer output is not affected. by setting bit 0 (toenn) of timer h mode register n (tmhmd n) to 1, a square wave of any frequency (duty = 50%) is output from tohn. (1) usage generates the inttmhn signal repeatedly at the same interval. <1> set each register. figure 9-9. register setting during interval timer/square-wave output operation (i) setting timer h mode register n (tmhmdn) 0 0/1 0/1 0/1 0 0 0/1 0/1 tmmdn0 tolevn toenn cksn1 cksn2 tmhen tmhmdn cksn0 tmmdn1 timer output setting timer output level inversion setting interval timer mode setting count clock (f cnt ) selection count operation stopped (ii) cmp0n register setting ? compare value (n) <2> count operation st arts when tmhen = 1. <3> when the values of 8-bit timer counter hn and the cmp0n register match, the inttmhn signal is generated and 8-bit timer counter hn is cleared to 00h. interval time = (n +1)/f cnt <4> subsequently, the inttmhn signal is generated at t he same interval. to stop the count operation, clear tmhen to 0. remark n = 0, 1
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 318 (2) timing chart the timing of the interval timer/square- wave output operation is shown below. figure 9-10. timing of interval timer/square-wave output operation (1/2) (a) basic operation 00h count clock count start 8-bit timer counter hn cmp0n tmhen inttmhn tohn 01h n clear interval time clear n 00h 01h n 00h 01h 00h <2> level inversion, match interrupt occurrence, 8-bit timer counter hn clear <2> level inversion, match interrupt occurrence, 8-bit timer counter hn clear <3> <1> <1> the count operation is enabled by setting the tmhen bi t to 1. the count clock starts counting no more than 1 clock after the operation is enabled. <2> when the values of 8-bit timer count er hn and the cmp0n register match, the value of 8-bit timer counter hn is cleared, the tohn output level is in verted, and the inttmhn signal is output. <3> the inttmhn signal and tohn output become inactive by clearing the tmhen bit to 0 during timer hn operation. if these are inactive from the first, the level is retained. remark n = 0, 1 n = 01h to feh
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 319 figure 9-10. timing of interval timer/square-wave output operation (2/2) (b) operation when cmp0n = ffh 00h count clock count start 8-bit timer counter hn cmp0n tmhen inttmhn tohn 01h feh clear clear ffh 00h feh ffh 00h ffh interval time (c) operation when cmp0n = 00h count clock count start 8-bit timer counter hn cmp0n tmhen inttmhn tohn 00h 00h interval time remark n = 0, 1
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 320 9.4.2 operation as pwm output mode in pwm output mode, a pulse with an arbi trary duty and arbitrary cycle can be output. 8-bit timer compare register 0n (cmp0n) controls the cycl e of timer output (tohn). re writing the cmp0n register during timer operation is prohibited. 8-bit timer compare register 1n (cmp1n) controls the dut y of timer output (tohn). re writing the cmp1n register during timer operation is possible. the operation in pwm output mode is as follows. pwm output (tohn output) output s an active level and 8-bit timer counter hn is cleared to 0 when 8-bit timer counter hn and the cmp0n register match after the timer count is started. pwm out put (tohn output) outputs an inactive level when 8-bit timer counter hn and the cmp1n register match. (1) usage in pwm output mode, a pulse for which an arbitrar y duty and arbitrary cycle can be set is output. <1> set each register. figure 9-11. register setting in pwm output mode (i) setting timer h mode register n (tmhmdn) 0 0/1 0/1 0/1 1 0 0/1 1 tmmdn0 tolevn toenn cksn1 cksn2 tmhen t mhmdn cksn0 tmmdn1 timer output enabled timer output level inversion settin g pwm output mode selection count clock (f cnt ) selection count operation stopped (ii) setting cmp0n register ? compare value (n): cycle setting (iii) setting cmp1n register ? compare value (m): duty setting remarks 1. n = 0, 1 2. 00h cmp1n (m) < cmp0n (n) ffh
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 321 <2> the count operation starts when tmhen = 1. <3> the cmp0n register is the compare register that is to be compared first after counter operation is enabled. when the values of 8-bit timer counter hn and the cmp0 n register match, 8-bit timer counter hn is cleared, an interrupt request signal (inttmhn ) is generated, and tohn output becomes active. at the same time, the compare register to be compared with 8-bit timer c ounter hn is changed from t he cmp0n register to the cmp1n register. <4> when 8-bit timer counter hn and the cmp1n regist er match, tohn output becomes inactive and the compare register to be compared with 8-bit timer coun ter hn is changed from the cmp1n register to the cmp0n register. at this time, 8-bit timer counter hn is not cleared and the inttmhn signal is not generated. <5> by performing procedures <3> and <4> repeatedl y, a pulse with an arbitrary duty can be obtained. <6> to stop the count operation, set tmhen = 0. if the setting value of the cmp0n register is n, the setting value of the cmp1n register is m, and the count clock frequency is f cnt , the pwm pulse output cycle and duty are as follows. pwm pulse output cycle = (n + 1)/f cnt duty = active width : total width of pwm = (m + 1) : (n + 1) cautions 1. in pwm output mode, three operation clocks (signal selected using the cksn2 to cksn0 bits of the tmhmdn register) are required to transfer the cmp1n register value after rewriting the register. 2. be sure to set the cmp1n register when starting the timer count operation (tmhen = 1) after the timer count operation was stopped (tmhen = 0) (be sure to set again even if setting the same value to the cmp1n register). remark n = 0, 1
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 322 (2) timing chart the operation timing in pwm output mode is shown below. caution make sure that the cmp1n register setting value (m) and cmp0 n register setting value (n) are within the following range. 00h cmp1n (m) < cmp0n (n) ffh figure 9-12. operation timing in pwm output mode (1/4) (a) basic operation count clock 8-bit timer counter hn cmp0n tmhen inttmhn tohn (tolevn = 0) tohn (tolevn = 1) 00h 01h a5h 00h 01h 02h a5h 00h a5h 00h 01h 02h cmp1n a5h 01h <1> <2> <3> <4> <1> the count operation is enabled by setting the tmhen bit to 1. start the 8-bit timer counter hn by masking one count clock to count up. at this ti me, pwm output outputs an inactive level. <2> when the values of the 8-bit time r counter hn and the cmp0n register ma tch, an active level is output. at this time, the value of the 8-bit timer counter hn is cleared, and the inttmhn signal is output. <3> when the values of the 8-bit timer counter hn and the cmp1n register match, an inactive level is output. at this time, the 8-bit timer counter value is not cleared and the inttmhn signal is not output. <4> clearing the tmhen bit to 0 during timer hn operat ion sets the inttmhn signal to the default and pwm output to an inactive level. remark n = 0, 1
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 323 figure 9-12. operation timing in pwm output mode (2/4) (b) operation when cmp0n = ffh, cmp1n = 00h count clock 8-bit timer counter hn cmp0n tmhen inttmhn tohn (tolevn = 0) 00h 01h ffh 00h 01h 02h ffh 00h ffh 00h 01h 02h cmp1n ffh 00h (c) operation when cmp0n = ffh, cmp1n = feh count clock 8-bit timer counter hn cmp0n tmhen inttmhn tohn (tolevn = 0) 00h 01h feh ffh 00h 01h feh ffh 00h 01h feh ffh 00h cmp1n ffh feh remark n = 0, 1
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 324 figure 9-12. operation timing in pwm output mode (3/4) (d) operation when cmp0n = 01h, cmp1n = 00h count clock 8-bit timer counter hn cmp0n tmhen inttmhn tohn (tolevn = 0) 01h 00h 01h 00h 01h 00h 00h 01h 00h 01h cmp1n 00h remark n = 0, 1
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 325 figure 9-12. operation timing in pwm output mode (4/4) (e) operation by changing cmp1n (cmp1n = 01h 03h, cmp0n = a5h) count clock 8-bit timer counter hn cmp0n tmhen inttmhn tohn (tolevn = 0) 00h 01h 02h a5h 00h 01h 02h 03h a5h 00h 01h 02h 03h a5h 00h cmp1n 01h a5h 03h 01h (03h) <1> <3> <4> <2> <2>' <5> <6> <1> the count operation is enabled by setting tmhen = 1. start the 8-bit timer counter hn by masking one count clock to count up. at this time, pwm output outputs an inactive level. <2> the cmp1n register value can be changed during timer counter operation. this operation is asynchronous to the count clock. <3> when the values of the 8-bit timer counter hn and t he cmp0n register match, t he value of the 8-bit timer counter hn is cleared, an active level is output, and the inttmhn signal is output. <4> if the cmp1n register value is c hanged, the value is latched and not tr ansferred to the register. when the values of the 8-bit timer counter hn and the cmp1 n register before the cha nge match, the value is transferred to the cmp1n register and the cm p1n register value is changed (<2>?). however, three count clocks or more are required fr om when the cmp1n register value is changed to when the value is transferred to the register. if a match signal is generated within th ree count clocks, the changed value cannot be transferred to the register. <5> when the values of the 8-bit timer counter hn and the cmp1n register after the change match, an inactive level is output. the 8-bit timer counter hn is not cleared and the inttmhn signal is not generated. <6> clearing the tmhen bit to 0 during timer hn operat ion sets the inttmhn signal to the default and pwm output to an inactive level. remark n = 0, 1
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 326 9.4.3 carrier generator mode operation (8-bit timer h1 only) the carrier clock generated by 8-bit timer h1 is output in the cycle set by 8-bit timer/event counter 51. in carrier generator mode, the output of the 8-bit timer h1 carrier pulse is controlled by 8-bit timer/event counter 51, and the carrier pulse is output from the toh1 output. (1) carrier generation in carrier generator mode, 8-bit timer h compare regist er 01 (cmp01) generates a low-level width carrier pulse waveform and 8-bit timer h compare register 11 (cmp11) generates a high-level width carrier pulse waveform. rewriting the cmp11 register during 8-bit timer h1 operat ion is possible but rewriti ng the cmp01 register is prohibited. (2) carrier output control carrier output is controlled by the in terrupt request signal (inttm51) of 8-bit timer/event counter 51 and the nrzb1 and rmc1 bits of the 8-bit timer h carrier co ntrol register (tmcyc1). the relationship between the outputs is shown below. rmc1 bit nrzb1 bit output 0 0 low-level output 0 1 high-level output 1 0 low-level output 1 1 carrier pulse output
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 327 to control the carrier pulse output during a count operation, the nrz1 and nrzb1 bits of the tmcyc1 register have a master and slave bit configuration. the nrz1 bit is read-only but the nrzb1 bit can be read and written. the inttm51 signal is synchronized with the 8-bit timer h1 count clock and output as the inttm5h1 signal. the inttm5h1 signal becomes the data transfer signal of the nrz1 bit, and the nrzb1 bit value is transferred to the nrz1 bit. the timing for transfer from the nrzb1 bit to the nrz1 bit is as shown below. figure 9-13. transfer timing 8-bit timer h1 count clock tmhe1 inttm51 inttm5h1 nrz1 nrzb1 rmc1 1 1 1 0 00 <1> <2> <1> the inttm51 signal is synchronized with the count cl ock of 8-bit timer h1 and is output as the inttm5h1 signal. <2> the value of the nrzb1 bit is transferred to the nrz 1 bit at the second clock from the rising edge of the inttm5h1 signal. cautions 1. do not rewrite the nrzb1 bit again until at least th e second clock afte r it has been rewritten, or else the transfer from the nrzb1 bit to the nrz1 bit is not guaranteed. 2. when 8-bit timer/event counter 51 is used in the carrier generator mode, an interrupt is generated at the timing of <1>. when 8-bit timer/event counter 51 is used in a mode other than the carrier generator mode, the timing of the interrupt generation differs.
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 328 (3) usage outputs an arbitrary carrier clock from the toh1 pin. <1> set each register. figure 9-14. register setting in carrier generator mode (i) setting 8-bit timer h m ode register 1 (tmhmd1) 0 0/1 0/1 0/1 0 timer output enabled timer output level inversion settin g carrier generator mode selection count clock (f cnt ) selection count operation stopped 1 0/1 1 tmmd10 tolev1 toen1 cks11 cks12 tmhe1 t mhmd1 cks10 tmmd11 (ii) cmp01 register setting ? compare value (iii) cmp11 register setting ? compare value (iv) tmcyc1 register setting ? rmc1 = 1 ... remote control output enable bit ? nrzb1 = 0/1 ... carrier output enable bit (v) tcl51 and tmc51 register setting ? see 8.3 registers controlling 8-bit timer/event counters 50 and 51 . <2> when tmhe1 = 1, 8-bit timer h1 starts counting. <3> when tce51 of 8-bit timer mode control register 51 (tmc 51) is set to 1, 8-bit timer/event counter 51 starts counting. <4> after the count operation is enabled, the first com pare register to be compared is the cmp01 register. when the count value of 8-bit time r counter h1 and the cmp 01 register value match, the inttmh1 signal is generated, 8-bit timer counter h1 is cleared, and at the same time, the compare register to be compared with 8-bit timer counter h1 is switched from the cmp01 register to the cmp11 register. <5> when the count value of 8-bit ti mer counter h1 and the cm p11 register value match, the inttmh1 signal is generated, 8-bit timer counter h1 is cleared, and at the same time, the compare register to be compared with 8-bit timer counter h1 is switched from the cmp11 register to the cmp01 register. <6> by performing procedures <4> and <5> repeatedly, a carrier clock is generated. <7> the inttm51 signal is synchronized with count clock of 8-bit timer h1 and output as the inttm5h1 signal. the inttm5h1 signal becomes the data transfer signal for the nrzb1 bit, and the nrzb1 bit value is transferred to the nrz1 bit. <8> when the nrz1 bit is high level, a carri er clock is output from the toh1 pin. <9> by performing the procedures above, an arbitrary carri er clock is obtained. to stop the count operation, clear tmhe1 to 0.
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 329 if the setting value of the cmp01 register is n, the setting value of the cmp 11 register is m, and the count clock frequency is f cnt , the carrier clock output cycle and duty are as follows. carrier clock output cycle = (n + m + 2)/f cnt duty = high-level width : carrier clock output width = ( m + 1) : (n + m + 2) cautions 1. be sure to set the cmp11 register when starting the timer count operation (tmhe1 = 1) after the timer count operation was stopped (tmhe1 = 0) (be sure to set again even if setting the same value to the cmp11 register). 2. set so that the count clock frequency of tmh1 becomes more than 6 times the count clock frequency of tm51. (4) timing chart the carrier output control timing is shown below. cautions 1. set the values of the cmp01 and cmp11 registers in a range of 01h to ffh. 2. in the carrier generator mode, three ope rating clocks (signal selected by cks12 to cks10 bits of tmhmd1 register) or more are required from when the cmp11 register value is changed to when the value is transferred to the register. 3. be sure to set the rmc1 bit before the count operation is started.
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 330 figure 9-15. carrier generator mode operation timing (1/3) (a) operation when cmp01 = n, cmp11 = n 00h n 00h n 00h n 00h n 00h n 00h n n n 0 0 1 1 0 0 1 1 0 0 00h 01h l 00h 01h l 00h 01h l 00h 01h 00h 01h l l cmpn0 cmpn1 tmhen inttmhn carrier clock 8-bit timer 5n count clock tm5n count value cr5n tce5n tohn inttm5n nrzbn nrzn carrier clock inttm5hn 8-bit timer hn count clock 8-bit timer counter hn count value <1> <2> <3> <4> <5> <6> <7> <1> when tmhe1 = 0 and tce51 = 0, 8-bit ti mer counter h1 operation is stopped. <2> when tmhe1 = 1 is set, 8-bit timer counter h1 starts a count operation. at that ti me, the carrier clock is held at the inactive level. <3> when the count value of 8-bit timer counter h1 matc hes the cmp01 register value, the first inttmh1 signal is generated, the carrier clock signal is inverted, and the compare register to be compared with 8-bit timer counter h1 is switched from the cmp01 register to the cmp11 register. 8-bit timer counter h1 is cleared to 00h. <4> when the count value of 8-bit timer counter h1 matc hes the cmp11 register value, the inttmh1 signal is generated, the carrier clock signal is inverted, and t he compare register to be compared with 8-bit timer counter h1 is switched from the cmp11 register to the cmp01 register. 8-bit timer counter h1 is cleared to 00h. by performing procedures <3> and <4> repeatedly, a carrier clock with duty fixed to 50% is generated. <5> when the inttm51 signal is generated, it is synchron ized with 8-bit timer h1 count clock and output as the inttm5h1 signal. <6> the inttm5h1 signal becomes the data transfer signal for the nrzb1 bit, and the nrzb1 bit value is transferred to the nrz1 bit. <7> when nrz1 = 0 is set, the toh1 output becomes low level.
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 331 figure 9-15. carrier generator mode operation timing (2/3) (b) operation when cmp01 = n, cmp11 = m n l 00h n 00h 01h m 00h n 00h 01h m 00h 00h n m 0 0 1 1 0 0 1 1 0 0 00h 01h l 00h 01h l 00h 01h l 00h 01h 00h 01h l cmpn0 cmpn1 tmhen inttmhn carrier clock 8-bit timer 5n count clock tm5n count value cr5n tce5n tohn inttm5n nrzbn nrzn carrier clock inttm5hn 8-bit timer hn count clock 8-bit timer counter hn count value <1> <2> <3> <4> <5> <6> <7> <1> when tmhe1 = 0 and tce51 = 0, 8-bit ti mer counter h1 operation is stopped. <2> when tmhe1 = 1 is set, 8-bit timer counter h1 starts a count operation. at that ti me, the carrier clock is held at the inactive level. <3> when the count value of 8-bit timer counter h1 matc hes the cmp01 register value, the first inttmh1 signal is generated, the carrier clock signal is inverted, and the compare register to be compared with 8-bit timer counter h1 is switched from the cmp01 register to the cmp11 register. 8-bit timer counter h1 is cleared to 00h. <4> when the count value of 8-bit timer counter h1 matc hes the cmp11 register value, the inttmh1 signal is generated, the carrier clock signal is inverted, and t he compare register to be compared with 8-bit timer counter h1 is switched from the cmp11 register to the cmp01 register. 8-bit timer counter h1 is cleared to 00h. by performing procedures <3> and <4> repeatedly, a carrier clock with duty fixed to other than 50% is generated. <5> when the inttm51 signal is generated, it is synchron ized with 8-bit timer h1 count clock and output as the inttm5h1 signal. <6> a carrier signal is output at the first rising edge of the carrier clock if nrz1 is set to 1. <7> when nrz1 = 0, the toh1 output is held at the high level and is not changed to low level while the carrier clock is high level (from <6> and <7>, the high-level width of the carrier clock waveform is guaranteed).
chapter 9 8-bit timers h0 and h1 user?s manual u19180ej1v0ud 332 figure 9-15. carrier generator mode operation timing (3/3) (c) operation when cmp11 is changed 8-bit timer h1 count clock cmp01 tmhe1 inttmh1 carrier clock 00h 01h n 00h 01h 01h m 00h n 00h l 00h <1> <3> <4> <3> <2> cmp11 <5> m n l m (l) 8-bit timer counter h1 count value <1> when tmhe1 = 1 is set, 8-bit timer h1 starts a count oper ation. at that time, the carrier clock is held at the inactive level. <2> when the count value of 8-bit timer counter h1 matches the cmp01 register value, 8-bit timer counter h1 is cleared and the inttmh1 signal is output. <3> the cmp11 register can be rewritten during 8-bit ti mer h1 operation, however, the changed value (l) is latched. the cmp11 register is changed when the count value of 8-bit timer counter h1 and the cmp11 register value before t he change (m) match (<3>?). <4> when the count value of 8-bit timer counter h1 and the cmp11 register value before the change (m) match, the inttmh1 signal is output, the carrier signal is inve rted, and 8-bit timer counter h1 is cleared to 00h. <5> the timing at which the count value of 8-bit timer counter h1 and the cmp11 regi ster value match again is indicated by the value after the change (l).
user?s manual u19180ej1v0ud 333 chapter 10 watch timer 10.1 functions of watch timer watch timer is mounted onto all 78k0/fx2 microcontroller products. the watch timer has the following functions. ? watch timer ? interval timer the watch timer and the interval timer can be used simultaneously. figure 10-1 shows the watch timer block diagram. figure 10-1. block diagram of watch timer f prs /2 7 f w /2 4 f w /2 5 f w /2 6 f w /2 7 f w /2 8 f w /2 10 f w /2 11 f w /2 9 f sub intwt intwti wtm0 wtm1 wtm2 wtm3 wtm4 wtm5 wtm6 wtm7 f w clear 11-bit prescaler clear 5-bit counter watch timer operation mode register (wtm) internal bus selector selector selector selector f wx /2 4 f wx /2 5 f wx remark f prs : peripheral hardware clock frequency f sub : subsystem clock frequency f w : watch timer clock frequency (f prs /2 7 or f sub ) f wx : f w or f w /2 9
chapter 10 watch timer user?s manual u19180ej1v0ud 334 (1) watch timer when the high-speed system clock or subsystem clock is used, interrupt reques ts (intwt) are generated at preset intervals. table 10-1. watch timer interrupt time interrupt time when operated at f sub = 32.768 khz when operated at f prs = 4 mhz when operated at f prs = 5 mhz when operated at f prs = 10 mhz when operated at f prs = 20 mhz 2 4 /f w 488 s 0.51 ms 410 s 205 s 102 s 2 5 /f w 977 s 1.03 ms 819 s 410 s 205 s 2 13 /f w 0.25 s 0.26 s 0.210 s 0.105 s 520 s 2 14 /f w 0.5 s 0.53 s 0.419 s 0. 210 s 0.105 s remark f prs : peripheral hardware clock frequency f sub : subsystem clock frequency f w : watch timer clock frequency (f prs /2 7 or f sub ) (2) interval timer interrupt requests (intwti) are gen erated at preset time intervals. table 10-2. interval timer interval time interrupt time when operated at f sub = 32.768 khz when operated at f prs = 4 mhz when operated at f prs = 5 mhz when operated at f prs = 10 mhz when operated at f prs = 20 mhz 2 4 /f w 488 s 0.51 ms 410 s 205 s 102 s 2 5 /f w 977 s 1.03 ms 820 s 410 s 205 s 2 6 /f w 1.95 ms 2.05 ms 1.64 ms 820 s 410 s 2 7 /f w 3.91 ms 4.1 ms 3.28 ms 1.64 ms 820 s 2 8 /f w 7.81 ms 8.2 ms 6.55 ms 3.28 ms 1.64 ms 2 9 /f w 15.6 ms 16.4 ms 13.1 ms 6.55 ms 3.28 ms 2 10 /f w 31.3 ms 32.75 ms 26.2 ms 13.1 ms 6.55 ms 2 11 /f w 62.5 ms 65.55 ms 52.4 ms 26.2 ms 13.1 ms remark f prs : peripheral hardware clock frequency f sub : subsystem clock frequency f w : watch timer clock frequency (f prs /2 7 or f sub ) 10.2 configuration of watch timer the watch timer includes the following hardware. table 10-3. watch timer configuration item configuration counter 5 bits 1 prescaler 11 bits 1 control register watch timer operation mode register (wtm)
chapter 10 watch timer user?s manual u19180ej1v0ud 335 10.3 register controlling watch timer the watch timer is controlled by the wa tch timer operation mode register (wtm). ? watch timer operation mode register (wtm) this register sets the watch time r count clock, enables/disables operation, prescaler interval time, and 5-bit counter operation control. wtm is set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears wtm to 00h.
chapter 10 watch timer user?s manual u19180ej1v0ud 336 figure 10-2. format of watch timer operation mode register (wtm) address: ff8fh after reset: 00h r/w symbol 7 6 5 4 3 2 <1> <0> wtm wtm7 wtm6 wtm5 wtm4 wtm3 wtm2 wtm1 wtm0 watch timer count clock selection (f w ) note wtm7 f sub = 32.768 khz f prs = 4 mhz f prs = 8 mhz f prs = 10 mhz f prs = 20 mhz 0 f prs /2 7 ? 31.25 khz 62.5 khz 78.125 khz 156.25 khz 1 f sub 32.768 khz ? wtm6 wtm5 wtm4 prescale r interval time selection 0 0 0 2 4 /f w 0 0 1 2 5 /f w 0 1 0 2 6 /f w 0 1 1 2 7 /f w 1 0 0 2 8 /f w 1 0 1 2 10 /f w 1 1 0 2 10 /f w 1 1 1 2 11 /f w wtm3 wtm2 interrupt time selection 0 0 2 14 /f w 0 1 2 13 /f w 1 0 2 5 /f w 1 1 2 4 /f w wtm1 5-bit counter operation control 0 clear after operation stop 1 start wtm0 watch timer operation enable 0 operation stop (clear both prescaler and 5-bit counter) 1 operation enable note the frequency that can be used for the peripheral hardware clock (f prs ) differs depending on the power supply voltage and product specifications. supply voltage peripheral hardware clock frequency 4.0 v v dd 5.5 v f prs 20 mhz 2.7 v v dd < 4.0 v f prs 10 mhz 1.8 v v dd < 2.7 v ((a) grade products only) f prs 5 mhz (the values shown in the table above are those when f prs = f xh (xsel = 1).) caution do not change the count clock and interval time (by setting bits 4 to 7 (wtm4 to wtm7) of wtm) during watch timer operation. remarks 1. f w : watch timer clock frequency (f prs /2 7 or f sub ) 2. f prs : peripheral hardware clock frequency 3. f sub : subsystem clock frequency
chapter 10 watch timer user?s manual u19180ej1v0ud 337 10.4 watch timer operations 10.4.1 watch timer operation the watch timer generates an interrupt request (intwt) at a specific time interval by using the peripheral hardware clock or subsystem clock. when bit 0 (wtm0) and bit 1 (wtm1) of the watch timer oper ation mode register (wtm) are set to 1, the count operation starts. when these bits are cleared to 0, t he 5-bit counter is cleared an d the count operation stops. when the interval timer is simultaneously operated, zero -second start can be achieved only for the watch timer by clearing wtm1 to 0. in this case, however, the 11-bi t prescaler is not cleared. therefore, an error up to 2 9 1/f w seconds occurs in the first overflow (intwt) after zero-second start. the interrupt request is generated at the following time intervals. table 10-4. watch timer interrupt time wtm3 wtm2 interrupt time selection when operated at f sub = 32.768 khz (wtm7 = 1) when operated at f prs = 4 mhz (wtm7 = 0) when operated at f prs = 5 mhz (wtm7 = 0) when operated at f prs = 10 mhz (wtm7 = 0) when operated at f prs = 20 mhz (wtm7 = 0) 0 0 2 14 /f w 0.5 s 0.53 s 0.419 s 0. 210 s 0.105 s 0 1 2 13 /f w 0.25 s 0.26 s 0.210 s 0.105 s 52.5 ms 1 0 2 5 /f w 977 s 1.03 ms 819 s 410 s 205 s 1 1 2 4 /f w 488 s 0.51 ms 410 s 205 s 102 s remarks 1. f w : watch timer clock frequency (f prs /2 7 or f sub ) 2. f prs : peripheral hardware clock frequency 3. f sub : subsystem clock frequency
chapter 10 watch timer user?s manual u19180ej1v0ud 338 10.4.2 interval timer operation the watch timer operates as interval timer which generates in terrupt requests (intwti) repeatedly at an interval of the preset count value. the interval time can be selected with bits 4 to 6 (w tm4 to wtm6) of the watch timer operation mode register (wtm). when bit 0 (wtm0) of the wtm is set to 1, the count operation starts. when this bit is set to 0, the count operation stops. table 10-5. interval timer interval time wtm6 wtm5 wtm4 interval time when operated at f sub = 32.768 khz (wtm7 = 1) when operated at f prs = 4 mhz (wtm7 = 0) when operated at f prs = 5 mhz (wtm7 = 0) when operated at f prs = 10 mhz (wtm7 = 0) when operated at f prs = 20 mhz (wtm7 = 0) 0 0 0 2 4 /f w 488 s 0.51 ms 410 s 205 s 102 s 0 0 1 2 5 /f w 977 s 1.03 ms 820 s 410 s 205 s 0 1 0 2 6 /f w 1.95 ms 2.05 ms 1.64 ms 820 s 410 s 0 1 1 2 7 /f w 3.91 ms 4.1 ms 3.28 ms 1.64 ms 820 s 1 0 0 2 8 /f w 7.81 ms 8.2 ms 6.55 ms 3.28 ms 1.64 ms 1 0 1 2 9 /f w 15.6 ms 16.4 ms 13.1 ms 6.55 ms 3.28 ms 1 1 0 2 10 /f w 31.3 ms 32.75 ms 26.2 ms 13.1 ms 6.55 ms 1 1 1 2 11 /f w 62.5 ms 65.55 ms 52.4 ms 26.2 ms 13.1 ms remarks 1. f w : watch timer clock frequency (f prs /2 7 or f sub ) 2. f prs : peripheral hardware clock frequency 3. f sub : subsystem clock frequency figure 10-3. operation timing of watch timer/interval timer 0h start overflow overflow 5-bit counter count clock watch timer interrupt intwt interval timer interrupt intwti interrupt time of watch timer (0.5 s) interval time (t) t interrupt time of watch timer (0.5 s) remark f w : watch timer clock frequency figures in parentheses are for operation with f w = 32.768 khz (wtm7 = 1, wtm3, wtm2 = 0, 0)
chapter 10 watch timer user?s manual u19180ej1v0ud 339 10.5 cautions for watch timer when operation of the watch timer and 5- bit counter is enabled by the watch timer mode control register (wtm) (by setting bits 0 (wtm0) and 1 (wtm1) of wtm to 1), the inte rval until the first interrupt request (intwt) is generated after the register is set does not exactly match the specif ication made with bits 2 and 3 (wtm2, wtm3) of wtm. subsequently, however, the intwt signal is generated at the s pecified intervals. figure 10-4. example of generation of watch timer interrupt request (intwt) (when interrupt period = 0.5 s) it takes 0.515625 seconds for the first intwt to be generated (2 9 1/32768 = 0.015625 s longer). intwt is then generated every 0.5 seconds. 0.5 s 0.5 s 0.515625 s wtm0, wtm1 intwt
user?s manual u19180ej1v0ud 340 chapter 11 watchdog timer 11.1 functions of watchdog timer the watchdog timer is mounted onto all 78k0/fx2 microcontroller products. the watchdog timer operates on the internal low-speed oscillation clock. the watchdog timer is used to detect an inadvertent program loop. if a program loop is detected, an internal reset signal is generated. program loop is detected in the following cases. ? if the watchdog timer counter overflows ? if a 1-bit manipulation instruction is execut ed on the watchdog timer enable register (wdte) ? if data other than ?ach? is written to wdte ? if data is written to wdte during a window close period ? if the instruction is fetched from an ar ea not set by the ims and ixs registers (detection of an invalid check while the cpu hangs up) ? if the cpu accesses an area that is not set by t he ims and ixs registers (excluding fb00h to ffcfh and ffe0h to ffffh) by executing a read/write instructi on (detection of an abnormal access during a cpu program loop) when a reset occurs due to the watchdog timer, bit 4 (wdtrf) of the reset control flag register (resf) is set to 1. for details of resf, see chapter 19 reset function .
chapter 11 watchdog timer user?s manual u19180ej1v0ud 341 11.2 configuration of watchdog timer the watchdog timer includes the following hardware. table 11-1. configuration of watchdog timer item configuration control register watchdog timer enable register (wdte) how the counter operation is controlled, overflow ti me, and window open period are set by the option byte. table 11-2. setting of option bytes and watchdog timer setting of watchdog timer option byte (0080h) window open period bits 6 and 5 (window1, window0) controlling counter operation of watchdog timer bit 4 (wdton) overflow time of watchdog timer bits 3 to 1 (wdcs2 to wdcs0) remark for the option byte, see chapter 23 option byte . figure 11-1. block diagram of watchdog timer f rl /2 clock input controller reset output controller internal reset signal internal bus selector 17-bit counter 2 10 /f rl to 2 17 /f rl watchdog timer enable register (wdte) clear, reset control wdton of option byte (0080h) window1 and window0 of option byte (0080h) count clear signal wdcs2 to wdcs0 of option byte (0080h) overflow signal cpu access signal cpu access error detector window size determination signal
chapter 11 watchdog timer user?s manual u19180ej1v0ud 342 11.3 register controlling watchdog timer the watchdog timer is controlled by the watchdog timer enable register (wdte). (1) watchdog timer enable register (wdte) writing ach to wdte clears the watchdog timer counter and starts counting again. this register can be set by an 8-bit memory manipulation instruction. reset signal generation sets this register to 9ah or 1ah note . figure 11-2. format of watchdog timer enable register (wdte) 0 1 2 3 4 5 6 7 symbol wdte address: ff9bh after reset: 9ah/1ah note r/w note the wdte reset value differs depending on the wdto n setting value of the option byte (0080h). to operate watchdog timer, set wdton to 1. wdton setting value wdte reset value 0 (watchdog timer count operation disabled) 1ah 1 (watchdog timer count operation enabled) 9ah cautions 1. if a value other than ach is written to wdte, an internal reset signal is generated. if the source clock to the watchdog timer is stopped, however, an internal reset signal is generated when the source clock to the watchdog timer resumes operation. 2. if a 1-bit memory manipulation instructio n is executed for wdte, an internal reset signal is generated. if the source clock to the watchdog timer is stopped, however, an internal reset signal is generated when the source clock to the watchdog timer resumes operation. 3. the value read from wdte is 9ah/1ah (this differs from the written value (ach)).
chapter 11 watchdog timer user?s manual u19180ej1v0ud 343 11.4 operation of watchdog timer 11.4.1 controlling operation of watchdog timer 1. when the watchdog timer is used, its operati on is specified by the option byte (0080h). ? enable counting operation of the watchdog timer by setting bit 4 (wdton) of the option byte (0080h) to 1 (the counter starts operating after a reset release) (for details, see chapter 23 ). wdton operation control of watchdog timer counter/illegal access detection 0 counter operation disabled (counting stopped after re set), illegal access detection operation disabled. 1 counter operation enabled (counting started after reset), illegal access detection operation enabled. ? set an overflow time by using bits 3 to 1 (wdcs2 to wdcs0) of the option byte (0080h) (for details, see 11.4.2 and chapter 23 ). ? set a window open period by using bits 6 and 5 (wi ndow1 and window0) of the option byte (0080h) (for details, see 11.4.3 and chapter 23 ). 2. after a reset release, the watchdog timer starts counting. 3. by writing ?ach? to wdte after the watchdog timer starts counting and before the overflow time set by the option byte, the watchdog timer is cl eared and starts counting again. 4. after that, write wdte the second time or later after a reset release during the window open period. if wdte is written during a period other than the window open period, an internal reset signal is generated. 5. if the overflow time expires without ?ach? written to wdte, an internal reset signal is generated. an internal reset signal is generated in the following cases. ? if a 1-bit manipulation instruction is execut ed on the watchdog timer enable register (wdte) ? if data other than ?ach? is written to wdte ? if the instruction is fetched from an area not set by t he ims and ixs registers (detection of an invalid check during a cpu program loop) ? if the cpu accesses an area not set by the ims and ixs registers (excluding fb00h to ffcfh and ffe0h to ffffh) by executing a read/write instruction ( detection of an abnormal access during a cpu program loop) cautions 1. the first writing to wdte after a reset release clears the watchdog timer, if it is made before the overflow time regardless of the timing of the writing, and the watchdog timer starts counting again. 2. if the watchdog timer is cleared by writin g ?ach? to wdte, the actual overflow time may be different from the overflow time set by the option byte by up to 2/f rl seconds. 3. the watchdog timer can be cleared immediately before the count value overflows (ffffh).
chapter 11 watchdog timer user?s manual u19180ej1v0ud 344 cautions 4. the operation of the watchdog timer in the halt and stop modes differs as follows depending on the set value of bit 0 (lsrosc) of the option byte. lsrosc = 0 (internal low-speed oscillator can be stopped by software) lsrosc = 1 (internal low-speed oscillator cannot be stopped) in halt mode watchdog timer operation continues. in stop mode watchdog timer operation stops. if lsrosc = 0, the watchdog timer resumes counting after the halt or stop mode is released. at this time, the counter is not cleared to 0 but starts counting from the value at which it was stopped. if oscillation of the internal low-speed oscilla tor is stopped by setting lsrstop (bit 1 of the internal oscillation mode register (rcm) = 1) when lsrosc = 0, the watchdog timer stops operating. at this time, the counter is not cleared to 0. 5. the watchdog timer continues its operation during self-programming and eeprom tm emulation of the flash memory. during processing, the interrupt acknowledge time is delayed. set the overflow time and window size taking this delay into consideration.
chapter 11 watchdog timer user?s manual u19180ej1v0ud 345 11.4.2 setting overflow time of watchdog timer set the overflow time of the watchdog timer by using bits 3 to 1 (wdcs2 to wdcs0) of the option byte (0080h). if an overflow occurs, an internal reset signal is generated. if ?ach? is written to wdte during the window open period before the overflow time, the present count is cleared and the watc hdog timer starts counting again. the following overflow time is set. table 11-3. setting of overflow time of watchdog timer wdcs2 wdcs1 wdcs0 overflow time of watchdog timer 0 0 0 2 10 /f rl (3.88 ms) 0 0 1 2 11 /f rl (7.76 ms) 0 1 0 2 12 /f rl (15.52 ms) 0 1 1 2 13 /f rl (31.03 ms) 1 0 0 2 14 /f rl (62.06 ms) 1 0 1 2 15 /f rl (124.12 ms) 1 1 0 2 16 /f rl (248.24 ms) 1 1 1 2 17 /f rl (496.48 ms) cautions 1. the combination of wdcs2 = wdcs1 = wdcs0 = 0 and window1 = window0 = 0 is prohibited. 2. the watchdog timer continues its operation during self-programming and eeprom emulation of the flash memory. during processing, the interrupt acknowledge time is delayed. set the overflow time and window size taking this delay into consideration. remarks 1. f rl : internal low-speed oscillation clock frequency 2. ( ): f rl = 264 khz (max.)
chapter 11 watchdog timer user?s manual u19180ej1v0ud 346 11.4.3 setting window open period of watchdog timer set the window open period of the watchdog timer by using bits 6 and 5 (window1 , window0) of the option byte (0080h). the outline of the window is as follows. ? if ?ach? is written to wdte during the window open per iod, the watchdog timer is cleared and starts counting again. ? even if ?ach? is written to wdte during the window cl ose period, an abnormality is detected and an internal reset signal is generated. example : if the window open period is 25% window close period (75%) window open period (25%) counting starts overflow time counting starts again when ach is written to wdte. internal reset signal is generated if ach is written to wdte. caution the first writing to wdte after a reset release clears the watchdog timer, if it is made before the overflow time regardless of the timing of the writing, and the watchdog timer starts counting again. the window open period to be set is as follows. table 11-4. setting window open period of watchdog timer window1 window0 window open period of watchdog timer 0 0 25% 0 1 50% 1 0 75% 1 1 100% cautions 1. the combination of wdcs2 = wdcs1 = wdcs0 = 0 and window1 = window0 = 0 is prohibited. 2. setting window1 = window0 = 0 is prohibited when using the watchdog timer at 1.8 v v dd < 2.7 v. 3 the watchdog timer continues its operation during self-programming and eeprom emulation of the flash me mory. during processing, the interrupt acknowledge time is delayed. set the overflow time and window size taking this delay into consideration.
chapter 11 watchdog timer user?s manual u19180ej1v0ud 347 remark if the overflow time is set to 2 11 /f rl , the window close time and open time are as follows. (when 2.7 v v dd 5.5 v) setting of window open period 25% 50% 75% 100% window close time 0 to 7.11 ms 0 to 4.74 ms 0 to 2.37 ms none window open time 7.11 to 7.76 ms 4.74 to 7.76 ms 2.37 to 7.76 ms 0 to 7.76 ms ? overflow time: 2 11 /f rl (max.) = 2 11 /264 khz (max.) = 7.76 ms ? window close time: 0 to 2 11 /f rl (min.) (1 ? 0.25) = 0 to 2 11 /216 khz (min.) 0.75 = 0 to 7.11 ms ? window open time: 2 11 /f rl (min.) (1 ? 0.25) to 2 11 /f rl (max.) = 2 11 /216 khz (min.) 0.75 to 2 11 /264 khz (max.) = 7.11 to 7.76 ms
user?s manual u19180ej1v0ud 348 chapter 12 clock output/buzzer output controller 12.1 functions of clock output/buzzer output controller the watchdog timer is mounted onto all 78k0/fx2 microcontroller products. the clock output controller is intended for carrier output during remote controlled transmission and clock output for supply to peripheral lsis. the clock selected with the clock output selection register (cks) is output. in addition, the buzzer output is intended for square- wave output of buzzer frequency selected with cks. figure 12-1 shows the block diagram of clock output/buzzer output controller. figure 12-1. block diagram of clock output/buzzer output controller f prs f prs /2 10 to f prs /2 13 f prs to f prs /2 7 f sub bzoe bcs1 bcs0 cloe cloe bzoe 84 pcl/intp6/p72 buz/intp7/p73 bcs0, bcs1 clock controller prescaler internal bus ccs3 clock output selection register (cks) ccs2 ccs1 ccs0 output latch (p73) pm73 output latch (p72) pm72 selector selector
chapter 12 clock output/buzzer output controller user?s manual u19180ej1v0ud 349 12.2 configuration of clock output/buzzer output controller the clock output/buzzer output controller includes the following hardware. table 12-1. clock output/buzzer output controller configuration item configuration control registers clock output selection register (cks) port mode register 7 (pm7) port register 7 (p7) 12.3 register controlling clock output/buzzer output controller the following two registers are used to control the clock output/buzzer output controller. ? clock output selection register (cks) ? port mode register 7 (pm7) (1) clock output selection register (cks) this register sets output enable/disable for clock out put (pcl) and for the buzzer frequency output (buz), and sets the output clock. cks is set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears cks to 00h.
chapter 12 clock output/buzzer output controller user?s manual u19180ej1v0ud 350 figure 12-2. format of clock output selection register (cks) address: ff40h after reset: 00h r/w symbol <7> 6 5 <4> 3 2 1 0 cks bzoe bcs1 bcs0 cloe ccs3 ccs2 ccs1 ccs0 bzoe buz output enable/disable specification 0 clock division circuit operation stopped. buz fixed to low level. 1 clock division circuit operat ion enabled. buz output enabled. buz output clock selection bcs1 bcs0 f prs = 10 mhz f prs = 20 mhz 0 0 f prs /2 10 9.77 khz 19.54 khz 0 1 f prs /2 11 4.88 khz 9.77 khz 1 0 f prs /2 12 2.44 khz 4.88 khz 1 1 f prs /2 13 1.22 khz 2.44 khz cloe pcl output enable/disable specification 0 clock division circuit operation stopped. pcl fixed to low level. 1 clock division circuit operat ion enabled. pcl output enabled. pcl output clock selection note 1 ccs3 ccs2 ccs1 ccs0 f sub = 32.768 khz f prs = 10 mhz f prs = 20 mhz 0 0 0 0 f prs note 2 10 mhz setting prohibited note 3 0 0 0 1 f prs /2 5 mhz 10 mhz 0 0 1 0 f prs /2 2 2.5 mhz 5 mhz 0 0 1 1 f prs /2 3 1.25 mhz 2.5 mhz 0 1 0 0 f prs /2 4 625 khz 1.25 mhz 0 1 0 1 f prs /2 5 312.5 khz 625 khz 0 1 1 0 f prs /2 6 156.25 khz 312.5 khz 0 1 1 1 f prs /2 7 ? 78.125 khz 156.25 khz 1 0 0 0 f sub 32.768 khz ? other than above setting prohibited notes 1. the frequency that can be used for the peripheral hardware clock (f prs ) differs depending on the power supply voltage and product specifications. supply voltage peripheral hardware clock (f prs ) 4.0 v v dd 5.5 v f prs 20 mhz 2.7 v v dd < 4.0 v f prs 10 mhz 1.8 v v dd < 2.7 v ((a) grade products only) f prs 5 mhz (the values shown in the table above are those when f prs = f xh (xsel = 1).)
chapter 12 clock output/buzzer output controller user?s manual u19180ej1v0ud 351 notes 2. if the peripheral hardware clock operates on the in ternal high-speed oscillation clock when 1.8 v v dd < 2.7 v, setting ccs3 = ccs2 = ccs1 = ccs0 = 0 (output clock of pcl: f prs ) is prohibited. 3. the pcl output clock prohibits settings if they exceed 10 mhz. cautions 1. set bcs1 and bcs0 when the buzzer output operation is stopped (bzoe = 0). 2. set ccs3 to ccs0 while the clock output operation is stopped (cloe = 0). remarks 1. f prs : peripheral hardware clock frequency 2. f sub : subsystem clock frequency (2) port mode register 7 (pm7) this register sets port 7 input/output in 1-bit units. when using the p72/intp6/pcl pin for clock output and the p73/intp7/buz pin for buzzer output, set pm72, pm73 and the output latch of p72, p73 to 0. pm7 is set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation sets pm7 to ffh. figure 12-3. format of port mode register 7 (pm7) address: ff27h after reset: ffh r/w symbol 7 6 5 4 3 2 1 0 pm7 1 pm76 pm75 pm74 pm73 pm72 pm71 pm70 pm7n p7n pin i/o mode selection (n = 0 to 6) 0 output mode (output buffer on) 1 input mode (output buffer off) remark the figure shown above presents the format of port mode register 7 of 78k0/ff2 products. for the format of port mode regi ster 7 of other products, see (1) port mode registers (pmxx) in 5.3 registers controlling port function .
chapter 12 clock output/buzzer output controller user?s manual u19180ej1v0ud 352 12.4 clock output/buzzer output controller operations 12.4.1 clock output operation the clock pulse is output as the following procedure. <1> select the clock pulse output frequency with bits 0 to 3 (ccs0 to ccs3) of the clock output selection register (cks) (clock pulse output in disabled status). <2> set bit 4 (cloe) of cks to 1 to enable clock output. remark the clock output controller is designed not to output pulses with a small width during output enable/disable switching of the clock output. as show n in figure 12-4, be sure to start output from the low period of the clock (marked with * in the figure) . when stopping output, do so after the high-level period of the clock. figure 12-4. remote control output application example cloe clock output ** 12.4.2 operation as buzzer output the buzzer frequency is output as the following procedure. <1> select the buzzer output frequency with bits 5 and 6 (b cs0, bcs1) of the clock output selection register (cks) (buzzer output in disabled status). <2> set bit 7 (bzoe) of cks to 1 to enable buzzer output.
user?s manual u19180ej1v0ud 353 chapter 13 a/d converter 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 3 y = 4 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 10-bit a/d converter 8 ch 9 ch 12 ch 16 ch 13.1 function of a/d converter the a/d converter converts an analog input signal into a di gital value, and consists of up to sixteen channels (ani0 to ani15) with a resolution of 10 bits. the a/d converter has the following function. ? 10-bit resolution a/d conversion 10-bit resolution a/d conversion is carried out repeatedly for one channel selected from analog inputs ani0 to ani15. each time an a/d conversion operation ends, an interrupt request (intad) is generated. figure 13-1. block diagram of a/d converter av ref av ss intad adcs bit adcs fr2 fr1 adce fr0 sample & hold circuit av ss voltage comparator a/d converter mode register (adm) internal bus 4 ads2 ads1 ads0 analog input channel specification register (ads) controller a/d conversion result register (adcr) successive approximation register (sar) lv1 lv0 5 a/d port configuration register (adpc) adpc3 adpc2 adpc1 adpc0 5 tap selector p80/ani0 p81/ani1 p82/ani2 p83/ani3 p84/ani4 p85/ani5 p86/ani6 p87/ani7 p90/ani8 p91/ani9 p92/ani10 p93/ani11 p94/ani12 p95/ani13 p96/ani14 p97/ani15 selector ads3 note adpc4 note ads3 is 48-pin products of 78k0/fc2, 78k0/fe2, and 78k0/ff2 only. remark ani0 to ani7: 44-pin products of 78k0/fc2 ani0 to ani8: 48-pin products of 78k0/fc2 ani0 to ani11: 78k0/fe2 ani0 to ani15: 78k0/ff2
chapter 13 a/d converter user?s manual u19180ej1v0ud 354 13.2 configuration of a/d converter the a/d converter includes the following hardware. (1) ani0 to ani15 pins these are the analog input pins of the 16-channel a/d converter. they input analog signals to be converted into digital signals. pins other than the one selected as the analog input pin can be used as i/o port pins. remark ani0 to ani7: 44-pin products of 78k0/fc2 ani0 to ani8: 48-pin products of 78k0/fc2 ani0 to ani11: 78k0/fe2 ani0 to ani15: 78k0/ff2 (2) sample & hold circuit the sample & hold circuit samples the input voltage of the analog input pin selected by the selector when a/d conversion is started, and holds the samp led voltage value during a/d conversion. (3) series resistor string the series resistor string is connected between av ref and av ss , and generates a voltage to be compared with the sampled voltage value. figure 13-2. circuit configuration of series resistor string adcs series resistor string av ref p-ch av ss (4) voltage comparator the voltage comparator compares the sa mpled voltage value and the output volt age of the series resistor string. (5) successive approximation register (sar) this register converts the result of comparison by the voltage comparator, starting from the most significant bit (msb). when the voltage value is converted into a digital value down to the least significant bit (lsb) (end of a/d conversion), the contents of the sar register are transfe rred to the a/d conversion result register (adcr). (6) 10-bit a/d conversion result register (adcr) the a/d conversion result is loaded from the successive approximation register to th is register each time a/d conversion is completed, and the adcr re gister holds the a/d conversion result in its higher 10 bits (the lower 6 bits are fixed to 0).
chapter 13 a/d converter user?s manual u19180ej1v0ud 355 (7) 8-bit a/d conversion result register (adcrh) the a/d conversion result is loaded from the successive approximation register to th is register each time a/d conversion is completed, and the adcrh register stores the higher 8 bi ts of the a/d conversion result. caution when data is read from adcr and adcrh, a wait cycle is genera ted. do not read data from adcr and adcrh when the cpu is operating on the subsystem clo ck and the peripheral hardware clock is stopped. for deta ils, see chapter 31 cautions for wait. (8) controller this circuit controls the conversion time of an input analog signal that is to be converted into a digital signal, as well as starting and stopping of t he conversion operation. when a/d c onversion has been completed, this controller generates intad. (9) av ref pin this pin inputs an analog power/reference voltage to the a/d converter. make this pin the same potential as the v dd pin when port 8 and port 9 are used as a digital port. the signal input to ani0 to ani15 is converted into a digital signal, based on the voltage applied across av ref and av ss . (10) av ss pin this is the ground potential pin of the a/d converter. always use this pin at the same potential as that of the v ss pin even when the a/d converter is not used. (11) a/d converter mode register (adm) this register is used to set the conver sion time of the analog input signal to be converted, and to start or stop the conversion operation. (12) a/d port configuration register (adpc) this register switches the p80/ani0 to p87/ani7, p90/ani8 to p97/ani 15 pins to analog input of a/d converter or digital i/o of port. (13) analog input channel specification register (ads) this register is used to specify the port that inputs the analog voltage to be converted into a digital signal. (14) port mode register 8 (pm8) this register switches the p80/ani0 to p87/ani7 pins to input or output. (15) port mode register 9 (pm9) this register switches the p90/ani8 to p97/ani15 pins to input or output. remark ani0 to ani7: 44-pin products of 78k0/fc2 ani0 to ani8: 48-pin products of 78k0/fc2 ani0 to ani11: 78k0/fe2 ani0 to ani15: 78k0/ff2
chapter 13 a/d converter user?s manual u19180ej1v0ud 356 13.3 registers used in a/d converter the a/d converter uses the following seven registers. ? a/d converter mode register (adm) ? a/d port configuratio n register (adpc) ? analog input channel specification register (ads) ? port mode register 8 (pm8) ? port mode register 9 (pm9) ? 10-bit a/d conversion result register (adcr) ? 8-bit a/d conversion result register (adcrh) (1) a/d converter mode register (adm) this register sets the conversion time for analog inpu t to be a/d converted, and starts/stops conversion. adm can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears this register to 00h. figure 13-3. format of a/d converter mode register (adm) adce lv0 note 1 lv1 note 1 fr0 note 1 fr1 note 1 fr2 note 1 0 adcs a/d conversion operation control stops conversion operation enables conversion operation adcs 0 1 <0> 1 2 3 4 5 6 <7> adm address: ff2ah after reset: 00h r/w symbol comparator operation control note 2 stops comparator operation enables comparator operation (comparator operation) adce 0 1 notes 1. for details of fr2 to fr0, lv 1, lv0, and a/d conversion, see table 13-2 a/d conversion time selection . 2. the operation of the compar ator is controlled by adcs and adce, and it takes 1 s from operation start to operation stabilization. theref ore, when adcs is set to 1 after 1 s or more has elapsed from the time adce is set to 1, the conversion result at that time has priority over the first conversion result. otherwise, ignore data of the first conversion.
chapter 13 a/d converter user?s manual u19180ej1v0ud 357 table 13-1. settings of adcs and adce adcs adce a/d conversion operation 0 0 stop status (dc power consumption path does not exist) 0 1 conversion waiting mode (comparator oper ation, only comparator consumes power) 1 0 conversion mode (comparator operation stopped note ) 1 1 conversion mode (comparator operation) note ignore data of the first conversion because it is not guaranteed range. figure 13-4. timing chart when comparator is used adce comparator adcs conversion operation conversion operation conversion stopped conversion waiting comparator operation note note to stabilize the internal circuit, the time from the rising of the adce bit to the rising of the adcs bit must be 1 s or longer. cautions 1. a/d conversion must be stopped before rewriting bits fr0 to fr2, lv1, and lv0 to values other than the identical data. 2. if data is written to adm, a wait cycle is generated. do not write data to adm when the cpu is operating on the subsystem clock and the peripheral hardware clock is stopped. for details, see chapter 31 cautions for wait.
chapter 13 a/d converter user?s manual u19180ej1v0ud 358 table 13-2. a/d conversion time selection (1) 2.7 v av ref 5.5 v (lv0 = 0) a/d converter mode register (adm) conversion time selection fr2 fr1 fr0 lv1 lv0 f prs = 4 mhz f prs = 10 mhz f prs = 20 mhz conversion clock (f ad ) 0 0 0 0 0 264/f prs 66.0 s 26.4 s 13.2 s f prs /12 0 0 1 0 0 176/f prs 44.0 s 17.6 s 8.8 s note f prs /8 0 1 0 0 0 132/f prs 33.0 s 13.2 s 6.6 s note f prs /6 0 1 1 0 0 88/f prs 22.0 s 8.8 s note f prs /4 1 0 0 0 0 66/f prs 16.5 s 6.6 s note f prs /3 1 0 1 0 0 44/f prs 11.0 s note setting prohibited setting prohibited f prs /2 other than above setting prohibited note this can be set only when 4.0 v av ref 5.5 v. (2) 2.3 v av ref 5.5 v (lv0 = 1) a/d converter mode register (adm) conversion time selection fr2 fr1 fr0 lv1 lv0 f prs = 2 mhz f prs = 5 mhz conversion clock (f ad ) 0 0 0 0 1 480/f prs setting prohibited f prs /12 0 0 1 0 1 320/f prs setting prohibited 64.0 s f prs /8 0 1 0 0 1 240/f prs 60.0 s 48.0 s f prs /6 0 1 1 0 1 160/f prs 40.0 s 32.0 s f prs /4 1 0 0 0 1 120/f prs 30.0 s 24.0 s note f prs /3 other than above setting prohibited note this can be set only when 2.7 v av ref 5.5 v. cautions 1. set the conversion times with the following conditions. (1) 2.7 v av ref 5.5 v (lv0 = 0) ? 4.0 v av ref 5.5 v: f ad = 0.33 to 3.6 mhz ? 2.7 v av ref < 4.0 v: f ad = 0.33 to 1.8 mhz (2) 2.3 v av ref 5.5 v (lv0 = 1) ? 4.0 v av ref 5.5 v: f ad = 0.6 to 3.6 mhz ? 2.7 v av ref < 4.0 v: f ad = 0.6 to 1.8 mhz ? 2.3 v av ref < 2.7 v: f ad = 0.6 to 1.48 mhz ((a) grade products only) 2. when rewriting fr2 to fr0, lv1, and lv0 to other than the same data, stop a/d conversion once (adcs = 0) beforehand. 3. change lv1 and lv0 from the default value, when 2.3 v av ref < 2.7 v. 4. the above conversion time does not include clock frequency errors. select conversion time, taking clock frequency errors into consideration. remark f prs : peripheral hardware clock frequency
chapter 13 a/d converter user?s manual u19180ej1v0ud 359 figure 13-5. a/d converter sampling and a/d conversion timing adcs wait period note conversion time conversion time sampling time sampling timing intad adcs 1 or ads rewrite sampling time sar clear sar clear transfer to adcr, intad generation successive conversion time note for details of wait period, see chapter 31 cautions for wait . (2) 10-bit a/d conversion result register (adcr) this register is a 16-bit register that stores the a/d conversion result. the lowe r 6 bits are fixed to 0. each time a/d conversion ends, the conversion resu lt is loaded from the successive appr oximation register, and is stored in adcr in order starting from bit 7 of ff19h. ff19h indi cates the higher 8 bits of the conversion result, and ff18h indicates the lower 2 bits of the conversion result. adcr can be read by a 16-bit memory manipulation instruction. reset signal generation clears this register to 0000h. figure 13-6. format of 10-bit a/d conversion result register (adcr) symbol address: ff18h, ff19h after reset: 0000h r ff19h ff18h 0 0 0 0 0 0 adcr cautions 1. when writing to the a/d converter mode register (adm), analog input channel specification register (ads), and a/d port configuration register (adpc), the contents of adcr may become undefined. read the conversion result following conversion completion before writing to adm, ads, and adpc. using timing other than the above may cause an incorrect conversion result to be read. 2. if data is read from adcr, a wait cycle is generated. do not read data from adcr when the cpu is operating on the subsystem clock and the peripheral hardware cl ock is stopped. for details, see chapter 31 cautions for wait.
chapter 13 a/d converter user?s manual u19180ej1v0ud 360 (3) 8-bit a/d conversion result register (adcrh) this register is an 8-bit register that stores the a/d conversion result. the higher 8 bits of 10-bit resolution are stored. adcrh can be read by an 8-bit memory manipulation instruction. reset signal generation clears this register to 00h. figure 13-7. format of 8-bit a/d conversion result register (adcrh) symbol adcrh a ddress: ff19h after reset: 00h r 76543210 cautions 1. when writing to the a/d converter mode register (adm), analog input channel specification register (ads), and a/d port configuration register (adpc), the contents of adcrh may become undefined. read the conversion result following conversion completion before writing to adm, ads, and adpc. using timing other than the above may cause an incorrect conversion result to be read. 2. if data is read from adcrh, a wait cycle is generated. do not read data from adcrh when the cpu is operating on the subsystem clock and the peripheral hardware clock is stopped. for details, see chapter 31 cautions for wait.
chapter 13 a/d converter user?s manual u19180ej1v0ud 361 (4) analog input channel specification register (ads) this register specifies the input port of the analog voltage to be a/d converted. ads can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears this register to 00h. figure 13-8. format of analog input channel specification register (ads) address: ff2bh after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 ads 0 0 0 0 ads3 ads2 ads1 ads0 ads3 ads2 ads1 ads0 anal og input channel specification 0 0 0 0 ani0 0 0 0 1 ani1 0 0 1 0 ani2 0 0 1 1 ani3 0 1 0 0 ani4 0 1 0 1 ani5 0 1 1 0 ani6 0 1 1 1 ani7 1 0 0 0 ani8 1 0 0 1 ani9 1 0 1 0 ani10 1 0 1 1 ani11 1 1 0 0 ani12 1 1 0 1 ani13 1 1 1 0 ani14 1 1 1 1 ani15 notes 1. setting permitted 2. setting prohibited cautions 1. be sure to clear bits 4 to 7 to 0. 2. because ads and adpc do not control input and output, set the channel used for a/d conversion in the input mode by using port mode register 8, 9 (pm8, pm9). if the channel is set in the output mode, selection of adpc is disabled. 3. do not set a pin to be used as a digital input pin with adpc with ads. 4. if data is written to ads, a wait cycle is generated. do not write data to ads when the cpu is operating on the subsystem clock and the periphe ral hardware clock is stopped. for details, see chapter 31 cautions for wait. remark ani0 to ani7 pins: 44-pin products of 78k0/fc2 ani0 to ani8 pins: 48-pin products of 78k0/fc2 ani0 to ani11 pins: 78k0/fe2 ani0 to ani15 pins: 78k0/ff2 fe2 note 1 note 1 note 2 note 2 note 1 48-pin of fc2 note 1 note 2 ff2 44-pin of fc2
chapter 13 a/d converter user?s manual u19180ej1v0ud 362 (5) a/d port configuration register (adpc) this register switches the p80/ani0 to p87/ani7, p90/ani8 to p97/ani 15 pins to analog input of a/d converter or digital i/o of port. adpc can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears this register to 00h. remark ani0 to ani7 pins: 44-pin products of 78k0/fc2 ani0 to ani8 pins: 48-pin products of 78k0/fc2 ani0 to ani11 pins: 78k0/fe2 ani0 to ani15 pins: 78k0/ff2
chapter 13 a/d converter user?s manual u19180ej1v0ud 363 figure 13-9. format of a/d port configuration register (adpc) address: ff22h after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 adpc 0 0 0 adpc4 adpc3 adpc2 adpc1 adpc0 analog input (a)/ digital input (d) switching a d p c 4 a d p c 3 a d p c 2 a d p c 1 a d p c 0 p97/ ani15 p96/ ani14 p95/ ani13 p94/ ani12 p93/ ani11 p92/ ani10 p91/ ani9 p90/ ani8 p87/ ani7 p86/ ani6 p85/ ani5 p84/ ani4 p83/ ani3 p82/ ani2 p81/ ani1 p80/ ani0 0 0 0 0 0 a a a a a a a a a a a a a a a a 0 0 0 0 1 a a a a a a a a a a a a a a a d 0 0 0 1 0 a a a a a a a a a a a a a a d d 0 0 0 1 1 a a a a a a a a a a a a a d d d 0 0 1 0 0 a a a a a a a a a a a a d d d d 0 0 1 0 1 a a a a a a a a a a a d d d d d 0 0 1 1 0 a a a a a a a a a a d d d d d d 0 0 1 1 1 a a a a a a a a a d d d d d d d 0 1 0 0 0 a a a a a a a a d d d d d d d d 0 1 0 0 1 a a a a a a a d d d d d d d d d 0 1 0 1 0 a a a a a a d d d d d d d d d d 0 1 0 1 1 a a a a a d d d d d d d d d d d 0 1 1 0 0 a a a a d d d d d d d d d d d d 0 1 1 0 1 a a a d d d d d d d d d d d d d 0 1 1 1 0 a a d d d d d d d d d d d d d d 0 1 1 1 1 a d d d d d d d d d d d d d d d 1 0 0 0 0 d d d d d d d d d d d d d d d d other than above setting prohibited notes 1. setting permitted 2. setting prohibited cautions 1. set the channel used for a/d conversion to the input mode by using port mode register 8 (pm8) and port mode re gister 9 (pm9). 2. do not set the pin set by adpc as digital i/o by analog input channel specification register (ads). 3. if data is written to adpc, a wait cycle is generated. do not write data to adpc when the cpu is operating on the subsystem clock and the peripheral hardware clock is stopped. for details, see chapter 31 cautions for wait. remark ani0 to ani7 pins: 44-pin products of 78k0/fc2 ani0 to ani8 pins: 48-pin products of 78k0/fc2 ani0 to ani11 pins: 78k0/fe2 ani0 to ani15 pins: 78k0/ff2 fe2 note 1 note 1 note 2 note 2 note 1 48-pin of fc2 note 1 note 2 ff2 44-pin of fc2
chapter 13 a/d converter user?s manual u19180ej1v0ud 364 (6) port mode register 8 (pm8) when using the p80/ani0 to p87/ani7 pins for analog input port, set pm80 to pm87 to 1. the output latches of p80 to p87 at this time may be 0 or 1. if pm80 to pm87 are set to 0, they cannot be used as analog input port pins. pm8 can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation sets this register to ffh. figure 13-10. format of port mode register 8 (pm8) address: ff28h after reset: ffh r/w symbol 7 6 5 4 3 2 1 0 pm8 pm87 pm86 pm85 pm84 pm83 pm82 pm81 pm80 pm8n p8n pin i/o mode selection (n = 0 to 7) 0 output mode (output buffer on) 1 input mode (output buffer off) (7) port mode register 9 (pm9) when using the p90/ani8 to p97/ani15 pins for analog in put port, set pm90 to pm97 to 1. the output latches of p90 to p97 at this time may be 0 or 1. if pm90 to pm97 are set to 0, they cannot be used as analog input port pins. pm9 can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation sets this register to ffh. remark ani8 pins: 48-pin products of 78k0/fc2 ani8 to ani11 pins: 78k0/fe2 ani8 to ani15 pins: 78k0/ff2 figure 13-11. format of port mode register 9 (pm9) address: ff29h after reset: ffh r/w symbol 7 6 5 4 3 2 1 0 pm9 pm97 pm96 pm95 pm94 pm93 pm92 pm91 pm90 pm9n p9n pin i/o mode selection (n = 0 to 7) 0 output mode (output buffer on) 1 input mode (output buffer off) remark the figure shown above presents the format of port mode register 9 of 78k0/ff2 products. for the format of port mode regi ster 9 of other products, see (1) port mode registers (pmxx) in 5.3 registers controlling port function .
chapter 13 a/d converter user?s manual u19180ej1v0ud 365 p80/ani0 to p87/ani7, p90/ani8 to p97/ani15 pins ar e as shown below depending on the settings of adpc, ads, pm8 and pm9. table 13-3. setting functions of p80/ani0 to p87/ani7, p90/ani8 to p97/ani15 pins adpc pm8, pm9 ads p80/ani0 to p87/ani7, p90/ani8 to p97/ani15 pins selects ani. analog input (to be converted) input mode does not select ani. analog input (not to be converted) selects ani. analog input selection output mode does not select ani. setting prohibited input mode ? digital input digital i/o selection output mode ? digital output remark ani0 to ani7 pins: 44-pin products of 78k0/fc2 ani0 to ani8 pins: 48-pin products of 78k0/fc2 ani0 to ani11 pins: 78k0/fe2 ani0 to ani15 pins: 78k0/ff2
chapter 13 a/d converter user?s manual u19180ej1v0ud 366 13.4 a/d converter operations 13.4.1 basic operations of a/d converter <1> set bit 0 (adce) of the a/d converter mode register (adm) to 1 to start the operation of the comparator. <2> set channels for a/d conversion to analog input by usi ng the a/d port configuration register (adpc) and set to input mode by using port mode register 8, 9 (pm8, pm9). <3> set a/d conversion time by using bits 5 to 1 (fr2 to fr0, lv1, and lv0) of adm. <4> select one channel for a/d conversion using the analog input channel specification register (ads). <5> start the conversion operation by setting bit 7 (adcs) of adm to 1. (<6> to <12> are operations performed by hardware.) <6> the voltage input to the selected analog input channel is sampled by the sample & hold circuit. <7> when sampling has been done for a certain time, the sa mple & hold circuit is placed in the hold state and the sampled voltage is held until the a/ d conversion operation has ended. <8> bit 9 of the successive approximation register (sar) is set. the series resistor string voltage tap is set to (1/2) av ref by the tap selector. <9> the voltage difference between the series resistor st ring voltage tap and sampled voltage is compared by the voltage comparator. if the analog input is greater than (1/2) av ref , the msb of sar remains set to 1. if the analog input is smaller than (1/2) av ref , the msb is reset to 0. <10> next, bit 8 of sar is automatically set to 1, and t he operation proceeds to the next comparison. the series resistor string voltage tap is selected according to the preset value of bit 9, as described below. ? bit 9 = 1: (3/4) av ref ? bit 9 = 0: (1/4) av ref the voltage tap and sampled voltage are compared and bit 8 of sar is manipulated as follows. ? analog input voltage voltage tap: bit 8 = 1 ? analog input voltage < voltage tap: bit 8 = 0 <11> comparison is continued in this way up to bit 0 of sar. <12> upon completion of the comparison of 10 bits, an effective digital result value remains in sar, and the result value is transferred to the a/d conversion resu lt register (adcr, adcrh) and then latched. at the same time, the a/d conversion end in terrupt request (intad) can also be generated. <13> repeat steps <6> to <12>, until adcs is cleared to 0. to stop the a/d converter, clear adcs to 0. to restart a/d conversion from the st atus of adce = 1, start from <5>. to start a/d conversion again when adce = 0, set adce to 1, wait for 1 s or longer, and start <5>. to change a channel of a/d conversion, start from <4>. caution make sure the period of <1> to <5> is 1 s or more. remark two types of a/d conversion re sult registers are available. ? adcr (16 bits): store 10-bit a/d conversion value ? adcrh (8 bits): store 8-bit a/d conversion value
chapter 13 a/d converter user?s manual u19180ej1v0ud 367 figure 13-12. basic operation of a/d converter conversion time sampling time sampling a/d conversion undefined conversion result a/d converter operation sar adcr intad conversion result a/d conversion operations are performed continuously until bit 7 (adcs) of t he a/d converter mode register (adm) is reset (0) by software. if a write operation is performed to the analog input chan nel specification register (a ds) during an a/d conversion operation, the conversion operation is in itialized, and if the adcs bit is set (1), conversion starts again from the beginning. reset signal generation clears the a/d conversion re sult register (adcr, adcrh) to 0000h or 00h.
chapter 13 a/d converter user?s manual u19180ej1v0ud 368 13.4.2 input voltage and conversion results the relationship between the analog input voltage input to the analog input pins (ani0 to ani15) and the theoretical a/d conversion result (stored in the 10-bit a/d conversion result register (adcr)) is shown by the following expression. sar = int ( 1024 + 0.5) adcr = sar 64 or (adcr ? 0.5) v ain < (adcr + 0.5) where, int( ): function which returns integer part of value in parentheses v ain : analog input voltage av ref : av ref pin voltage adcr: a/d conversion result register (adcr) value sar: successive approximation register remark ani0 to ani7 pins: 44-pin products of 78k0/fc2 ani0 to ani8 pins: 48-pin products of 78k0/fc2 ani0 to ani11 pins: 78k0/fe2 ani0 to ani15 pins: 78k0/ff2 v ain av ref av ref 1024 av ref 1024
chapter 13 a/d converter user?s manual u19180ej1v0ud 369 figure 13-13 shows the relationship between the analo g input voltage and the a/d conversion result. figure 13-13. relationship between analog input voltage and a/d conversion result 1023 1022 1021 3 2 1 0 ffc0h ff80h ff40h 00c0h 0080h 0040h 0000h a/d conversion result (adcr) sar adcr 1 2048 1 1024 3 2048 2 1024 5 2048 input voltage/av ref 3 1024 2043 2048 1022 1024 2045 2048 1023 1024 2047 2048 1
chapter 13 a/d converter user?s manual u19180ej1v0ud 370 13.4.3 a/d converter operation mode the operation mode of the a/d c onverter is the select mode. one channel of analog input is selected from ani0 to ani15 by the analog input channel specificati on register (ads) and a/d conversion is executed. remark ani0 to ani7 pins: 44-pin products of 78k0/fc2 ani0 to ani8 pins: 48-pin products of 78k0/fc2 ani0 to ani11 pins: 78k0/fe2 ani0 to ani15 pins: 78k0/ff2 (1) a/d conversion operation by setting bit 7 (adcs) of the a/d converter mode regist er (adm) to 1, the a/d c onversion operation of the voltage, which is applied to the analog input pin specified by the analog in put channel specification register (ads), is started. when a/d conversion has been completed, the result of the a/d c onversion is stored in t he a/d conversion result register (adcr), and an interrupt request signal (int ad) is generated. when one a/d conversion has been completed, the next a/d conversion operation is immedi ately started. if ads is rewritten during a/d conversion, the a/d conv ersion operation under execut ion is stopped and restarted from the beginning. if 0 is written to adcs during a/d conversion, a/d conv ersion is immediately stopped. at this time, the conversion result immediat ely before is retained. figure 13-14. a/d conversion operation anin rewriting adm adcs = 1 rewriting ads adcs = 0 anin anin anin anim anin anim anim stopped conversion result immediately before is retained a/d conversion adcr, adcrh intad conversion is stopped conversion result immediately before is retained remarks 1. 44-pin products of 78k0/fc2: n = 0 to 7, 48-pin products of 78k0/fc2: n = 0 to 8, 78k0/fe2: n = 0 to 11, 78k0/ff2: n = 0 to 15 2. 44-pin products of 78k0/fc2: m = 0 to 7, 48-pin products of 78k0/fc2: m = 0 to 8, 78k0/fe2: m = 0 to 11, 78k0/ff2: m = 0 to 15
chapter 13 a/d converter user?s manual u19180ej1v0ud 371 the setting methods are described below. <1> set bit 0 (adce) of the a/d converter mode register (adm) to 1. <2> set the channel to be used in the analog input m ode by using bits 4 to 0 (adpc4 to adpc0) of the a/d port configuration register (adpc) and bits 7 to 0 (pm 87 to pm80) of port mode register 8 (pm8), bits 7 to 0 (pm97 to pm90) of port mode register 9 (pm9). <3> select conversion time by using bits 5 to 1 (fr2 to fr0, lv1, and lv0) of adm. <4> select a channel to be used by using bits 3 to 0 (ads3 to ads0) of the analog input channel specification register (ads). <5> set bit 7 (adcs) of adm to 1 to start a/d conversion. <6> when one a/d conversion has been completed, an interrupt request signal (intad) is generated. <7> transfer the a/d conversion data to the a/d conversion result register (adcr, adcrh). <8> change the channel using bits 3 to 0 (ads 3 to ads0) of ads to start a/d conversion. <9> when one a/d conversion has been completed, an interrupt request signal (intad) is generated. <10> transfer the a/d conversion data to the a/d conversion result register (adcr, adcrh). <11> clear adcs to 0. <12> clear adce to 0. cautions 1. make sure the period of <1> to <5> is 1 s or more. 2. <1> may be done between <2> and <4>. 3. <1> can be omitted. however, ignore data of the first conversion after <5> in this case. 4. the period from <6> to <9> differs from the conversion time set using bits 5 to 1 (fr2 to fr0, lv1, lv0) of adm. the period from <8 > to <9> is the conversion time set using fr2 to fr0, lv1, and lv0.
chapter 13 a/d converter user?s manual u19180ej1v0ud 372 13.5 how to read a/d converter characteristics table here, special terms unique to the a/d converter are explained. (1) resolution this is the minimum analog input vo ltage that can be identif ied. that is, the perce ntage of the analog input voltage per bit of digital output is called 1lsb (least signi ficant bit). the percentage of 1lsb with respect to the full scale is expressed by %fsr (full scale range). 1lsb is as follows when t he resolution is 10 bits. 1lsb = 1/2 10 = 1/1024 = 0.098%fsr accuracy has no relation to resolution, but is determined by overall error. (2) overall error this shows the maximum error value between the actual measured value and the theoretical value. zero-scale error, full-scale error, integral linearity error, and differential linearity errors that are combinations of these express the overall error. note that the quantization error is not included in the overall erro r in the characteristics table. (3) quantization error when analog values are converted to digital values, a 1/2lsb error naturally occurs. in an a/d converter, an analog input voltage in a range of 1/2lsb is converted to the same digita l code, so a quantization error cannot be avoided. note that the quantization erro r is not included in the overall error, zero -scale error, full-scale error, integral linearity error, and differential linearity error in the characteristics table. figure 13-15. overall error figure 13-16. quantization error ideal line 0 0 1 1 digital output overall error analog input av ref 0 0 0 1 1 digital output quantization error 1/2lsb 1/2lsb analog input 0 av ref (4) zero-scale error this shows the difference between the actual measuremen t value of the analog input vo ltage and the theoretical value (1/2lsb) when the digital output changes from 0......000 to 0......001. if the actual measurement value is greater than the theore tical value, it shows the difference between the actual measurement value of the analog in put voltage and the theoret ical value (3/2lsb) when the digital output changes from 0??001 to 0??010.
chapter 13 a/d converter user?s manual u19180ej1v0ud 373 (5) full-scale error this shows the difference between the actual measuremen t value of the analog input vo ltage and the theoretical value (full-scale ? 3/2lsb) when the digital output chan ges from 1......110 to 1......111. (6) integral linearity error this shows the degree to which the conversion charac teristics deviate from the ideal linear relationship. it expresses the maximum value of the difference between the actual measurement value and the ideal straight line when the zero-scale error and full-scale error are 0. (7) differential linearity error while the ideal width of code output is 1lsb, this indicates the difference between the actual measurement value and the ideal value. figure 13-17. zero-scale error figure 13-18. full-scale error 111 011 010 001 zero-scale error ideal line 000 01 2 3 av ref digital output (lower 3 bits) analog input (lsb) 111 110 101 000 0 av ref ? 3 full-scale error ideal line analog input (lsb) digital output (lower 3 bits) av ref ? 2av ref ? 1 av ref figure 13-19. integral linearity error figure 13-20. differential linearity error 0 av ref digital output analog input integral linearity error ideal line 1 1 0 0 0 av ref digital output analog input differential linearity error 1 1 0 0 ideal 1lsb width (8) conversion time this expresses the time from the start of samp ling to when the digital output is obtained. the sampling time is included in the conv ersion time in the characteristics table. (9) sampling time this is the time the analog switch is turned on for the anal og voltage to be sampled by the sample & hold circuit. sampling time conversion time
chapter 13 a/d converter user?s manual u19180ej1v0ud 374 13.6 cautions for a/d converter (1) operating current in stop mode the a/d converter stops operating in the stop mode. at this time, th e operating current can be reduced by clearing bit 7 (adcs) and bit 0 (adce) of the a/d converter mode register (adm) to 0. to restart from the standby status, clear bit 6 (adif) of interrupt request fl ag register 1l (if1l) to 0 and start operation. (2) input range of ani0 to ani15 observe the rated range of the ani0 to an i15 input voltage. if a voltage of av ref or higher and av ss or lower (even in the range of absolute maximum ratings) is input to an analog input channel, the converted value of that channel becomes undefined. in addition, the converted values of the other channels may also be affected. (3) conflicting operations <1> conflict between a/d conversion result regist er (adcr, adcrh) write and adcr or adcrh read by instruction upon the end of conversion adcr or adcrh read has priority. after the read op eration, the new conversion result is written to adcr or adcrh. <2> conflict between adcr or adcrh write and a/d conv erter mode register (adm) write, analog input channel specification register (ads), or a/d port configuration register (a dpc) write upon the end of conversion adm, ads, or adpc write has priority. adcr or ad crh write is not performed, nor is the conversion end interrupt signal (intad) generated. (4) noise countermeasures to maintain the 10-bit resolution, attent ion must be paid to noise input to the av ref pin and pins ani0 to ani15. <1> connect a capacitor with a low equivalent resistance and a good frequency response to the power supply. <2> the higher the output impedance of the analog input source, the great er the influence. to reduce the noise, connecting external c as shown in figure 13-21 is recommended. <3> do not switch these pins with other pins during conversion. <4> the accuracy is improved if the halt mode is set immediately after the start of conversion. remark ani0 to ani7 pins: 44-pin products of 78k0/fc2 ani0 to ani8 pins: 48-pin products of 78k0/fc2 ani0 to ani11 pins: 78k0/fe2 ani0 to ani15 pins: 78k0/ff2
chapter 13 a/d converter user?s manual u19180ej1v0ud 375 figure 13-21. analog input pin connection r eference voltage input c = 100 to 1,000 pf if there is a possibility that noise equal to or higher than av ref o r equal to or lower than av ss may enter, clamp with a diode with a small v f value (0.3 v or lower). av ref av ss v ss ani0 to ani15 (5) p80/ani0 to p87/ani7, p90/ani8 to p97/ani15 <1> the analog input pins (ani0 to ani15) are also used as i/o port pins (p80 to p87, p90 to p97). when a/d conversion is performed with any of ani0 to ani15 selected, do not access p80 to p87, p90 to p97 while conversion is in progress; otherwise the conversion resolution may be degraded. it is recommended to select pins used as p80 to p87, p90 to p97 starting with the p80/an i0 that is the furthest from av ref . <2> if a digital pulse is applied to the pins adjacent to t he pins currently used for a/ d conversion, the expected value of the a/d conversion may not be obtained due to coupling noise. therefore, do not apply a pulse to the pins adjacent to the pi n undergoing a/d conversion. (6) input impedance of ani0 to ani15 pins this a/d converter charges a sampling capacitor for sampling during sampling time. therefore, only a leakage current fl ows when sampling is not in progre ss, and a current that charges the capacitor flows during sampling. consequently, the input impedance fluctuates depending on whether sampling is in progress, and on the other states. to make sure that sampling is effective, however, it is recommended to keep the out put impedance of the analog input source to within 10 k , and to connect a capacitor of about 100 pf to the ani0 to ani15 pins (see figure 13-21 ). (7) av ref pin input impedance a series resistor string of several tens of k is connected between the av ref and av ss pins. therefore, if the output imped ance of the reference voltage source is high, this will result in a series connection to the series resistor string between the av ref and av ss pins, resulting in a large reference voltage error. remark ani0 to ani7 pins: 44-pin products of 78k0/fc2 ani0 to ani8 pins: 48-pin products of 78k0/fc2 ani0 to ani11 pins: 78k0/fe2 ani0 to ani15 pins: 78k0/ff2
chapter 13 a/d converter user?s manual u19180ej1v0ud 376 (8) interrupt request flag (adif) the interrupt request flag (adif) is not cleared even if th e analog input channel specification register (ads) is changed. therefore, if an analog input pin is changed during a/d conversion, the a/d conversion result and adif for the pre-change analog input may be set just before the ads rewrit e. caution is therefore re quired since, at this time, when adif is read immediately after the ads rewrite, ad if is set despite the fact a/d conversion for the post- change analog input has not ended. when a/d conversion is stopped and then resumed, clear ad if before the a/d conversion operation is resumed. figure 13-22. timing of a/d conversion end interrupt request generation ads rewrite (start of anin conversion) a /d conversion adcr adif anin anin anim anim anin anin anim anim ads rewrite (start of anim conversion) adif is set but anim conversion has not ended. remarks 1. 44-pin products of 78k0/fc2: n = 0 to 7, 48-pin products of 78k0/fc2: n = 0 to 8, 78k0/fe2: n = 0 to 11, 78k0/ff2: n = 0 to 15 2. 44-pin products of 78k0/fc2: m = 0 to 7, 48-pin products of 78k0/fc2: m = 0 to 8, 78k0/fe2: m = 0 to 11, 78k0/ff2: m = 0 to 15 (9) conversion results just after a/d conversion start the first a/d conversion value immediately after a/d conv ersion starts may not fall within the rating range if the adcs bit is set to 1 within 1 s after the adce bit was set to 1, or if the adcs bit is set to 1 with the adce bit = 0. take measures such as polling the a/d conversi on end interrupt request (intad) and removing the first conversion result. (10) a/d conversion result register (adcr, adcrh) read operation when a write operation is performed to the a/d conver ter mode register (adm), analog input channel specification register (ads), and a/ d port configuration register (adp c), the contents of adcr and adcrh may become undefined. read the conversion result following co nversion completion before writing to adm, ads, and adpc. using a timing other than the above may cause an incorrect conversion result to be read.
chapter 13 a/d converter user?s manual u19180ej1v0ud 377 (11) internal equivalent circuit the equivalent circuit of the analog input block is shown below. figure 13-23. internal equivalent circuit of anin pin anin c1 c2 r1 table 13-4. resistance and capacitance values of equivalent circuit (reference values) av ref r1 c1 c2 4.0 v av ref 5.5 v 8.1 k 8 pf 5 pf 2.7 v av ref < 4.0 v 31 k 8 pf 5 pf 2.3 v av ref < 2.7 v 381 k 8 pf 5 pf remarks 1. the resistance and capacitance values shown in table 13-4 are not guaranteed values. 2. 44-pin products of 78k0/fc2: n = 0 to 7, 48-pin products of 78k0/fc2: n = 0 to 8, 78k0/fe2: n = 0 to 11, 78k0/ff2: n = 0 to 15
user?s manual u19180ej1v0ud 378 chapter 14 serial interfaces uart60 and uart61 14.1 functions of serial interfaces uart60 and uart61 the serial interfaces uart60 and uart61 is mounted onto all 78k0/fx2 microcontroller products. serial interfaces uart60 and uart61 have the following two modes. (1) operation stop mode this mode is used when serial communication is not executed and can enable a reduction in the power consumption. for details, see 14.4.1 operation stop mode . (2) asynchronous serial interface (uart) mode this mode supports the lin (local interconnect network) -bus. the functions of this mode are outlined below. for details, see 14.4.2 asynchronous serial interface (uart) mode and 14.4.3 dedicated baud rate generator . ? maximum transfer rate: 625 kbps ? two-pin configuration txd 6n: transmit data output pin r x d6n: receive data input pin ? data length of communication data can be selected from 7 or 8 bits. ? dedicated internal 8-bit baud rate generator allowing any baud rate to be set ? transmission and reception can be performe d independently (full-duplex operation). ? twelve operating clock inputs selectable ? msb- or lsb-first communication selectable ? inverted transmission operation ? sync break field transmission from 13 to 20 bits ? more than 11 bits can be identified for sync break field reception (sbf reception flag provided). cautions 1. the t x d6n output inversion function inverts only the transmission side and not the reception side. to use this function, the reception side must be ready for reception of inverted data. 2. if clock supply to serial interfaces uart60 and uart61 are not stopped (e.g., in the halt mode), normal operation continues. if clock supply to serial interfaces uart60 and uart61 are stopped (e.g., in the stop mode), each register st ops operating, and holds the value immediately before clock supply was stopped. the t x d6n pins also holds the value immediately before clock supply was stopped and outputs it. however, the operation is not guaranteed after clock supply is resumed. therefore, reset the circuit by setting power6n = 0, rxe6n = 0, and txe6n = 0. 3. set power6n = 1 and then set txe6n = 1 (transmission) or rxe6n = 1 (reception) to start communication. 4. txe6n and rxe6n are synchronized by the base clock (f xclk6 ) set by cksr6n. to enable transmission or reception again, set txe6n or rxe6n to 1 at least two clocks of the base clock after txe6n or rxen6 has been cleared to 0. if txe6n or rxe6n is set within two clocks of the base clock, the transmission circui t or reception circuit may not be initialized. 5. set transmit data to txb6n at least one base clock (f xclk6 ) after setting txe6n = 1.
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 379 cautions 6. if data is continuously transmitted, the communication timing from the stop bit to the next start bit is extended two operating clocks of the macro. however, this does not affect the result of communication because the recepti on side initializes the timing when it has detected a start bit. do not use the contin uous transmission function if the interface is used in lin communication operation. remarks 1 . lin stands for local interconnect network and is a low-speed (1 to 20 kbps) serial communication protocol intended to aid the cost reduction of an automotive network. lin communication is single-master communication, and up to 15 slaves can be connected to one master. the lin slaves are used to control the sw itches, actuators, and sensors, and these are connected to the lin mast er via the lin network. normally, the lin master is connected to a network such as can (controller area network). in addition, the lin bus uses a single-wire method and is connected to the nodes via a transceiver that complies with iso9141. n the lin protocol, the master transmits a frame with baud rate information and the slave receives it and corrects the baud rate error. t herefore, communication is possible when the baud rate error in the slave is 15% or less. 2. n = 0, 1 figures 14-1 and 14-2 outline the transmi ssion and reception op erations of lin. figure 14-1. lin transmission operation lin bus wakeup signal frame 8 bits note 1 55h transmission data transmission data transmission data transmission data transmission 13-bit note 2 sbf transmission note 3 sync break field sync field identifier field data field data field checksum field txd6n (output) intst6n notes 1. the wakeup signal frame is substituted by 80h transmission in the 8-bit mode. 2. the sync break field is output by hardware. the output width is the bit length set by bits 4 to 2 (sbl62n to sbl60n) of asynchronous serial interface control register 6n (asicl6n). if more precise output width adjustment is necessary, use baud rate generator control register 6n (brgc6n) (see 14.4.2 (2) (h) sbf transmission ). 3. intst6n is output on completion of each transmission. it is also output when sbf is transmitted. remark the interval between each field is controlled by software. n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 380 figure 14-2. lin reception operation lin bus 13-bit sbf reception sf reception id reception data reception data reception data reception <3> <1> <4> wakeup signal frame sync break field sync field identifer field data field data field checksum field rxd6n reception interrupt (intsr6n) edge detection (intpn) capture timer disable enable disable enable <2> <5> reception processing is as follows. <1> the wakeup signal is detected at the edge of t he pin, and enables uart6n and sets the sbf reception mode. <2> reception continues until the stop bit is detected. when an sbf with low- level data of 11 bits or more has been detected, it is assum ed that sbf reception has been completed correctly, and an interrupt signal is output. if an sbf with low-level data of less than 11 bits has been detected, it is assumed that an sbf reception error has occurred. the interrupt signal is not output and the sbf rec eption mode is restored. <3> if sbf reception has been completed correctly, an interru pt signal is output. start 16-bit timer/event counter 00 by the sbf reception end interrupt servicing and measur e the bit interval (pulse width) of the sync field (see 7.4.3 pulse width measurement operation ). detection of errors ove6n, pe6n, and fe6n is suppressed, and error detection proc essing of uart communication and dat a transfer of the shift register and rxb6n is not performed. the shift register holds the reset value ffh. <4> calculate the baud rate error from the bit length of the sync field, disable uart6n after sf reception, and then re-set baud rate generator control register 6n (brgc6n). <5> distinguish the checksum field by software. also perform processing by software to initialize uart6n after reception of the checksum field and to set the sbf reception mode again. remark n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 381 figure 14-3 to 14-5 show the port config uration for lin reception operation. the wakeup signal transmitted from the lin master is re ceived by detecting the edge of the external interrupt (intp0 and intp1). the length of the sync field transmitted from the lin master can be m easured using the external event capture operation of 16-bit ti mer/event counter 00, 01, and the ba ud rate error can be calculated. the input source of the reception port input (rxd60 and rx d61) can be input to the external interrupt (intp0 and intp1) and 16-bit timer/event counter 00, 01 by port input switch control (isc ), without connecting rxd60, rxd61, intp0, intp1, ti010 and ti001 externally. figure 14-3. port configuration fo r lin reception operation (uart60) rxd60 input p14/rxd60 port mode (pm14) output latch (p14) selector ti010 input p01/ti010 port input switch control (isc1) 0: select ti010 (p01) 1: select rxd60 (p14) port mode (pm01) output latch (p01) selector selector intp0 input p120/intp0 port input switch control (isc3) 0: select intp0 (p120) 1: select rxd60 (p14) port mode (pm120) output latch (p120) selector selector remark isc1, isc3: bits 1 and 3 of the input switch control register (isc) (see figure 14-20 ) the peripheral functions used in the lin communication operation are shown below. ? external interrupt (intp0); wakeup signal detection use: detects the wakeup signal edges and detects start of communication. ? 16-bit timer/event counter 00 (ti010); baud rate error detection use: detects the baud rate error (meas ures the ti010 input edge interval in the capture mode) by detecting the sync field (sf) length and divides it by the number of bits. ? serial interface uart60.
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 382 figure 13-4. port configuration for li n reception operation: 78k0/fc2 (uart61) rxd61 input p11/rxd61 port mode (pm11) output latch (p11) selector intp1 input p30/intp1 port input switch control (isc4) 0: select intp1 (p30) 1: select rxd61 (p11) port mode (pm30) output latch4 (p30) selector selector remark isc4: bit 4 of the input switch control register (isc) (see figure 13-20 ) the peripheral functions used in the lin communication operation are shown below. ? external interrupt (intp1); wakeup signal detection use: detects the wakeup signal edges and detects start of communication. ? serial interface uart61.
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 383 figure 14-5. port configuration for lin recep tion operation: 78k0/fe2, 78k0/ff2 (uart61) rxd61 input p11/rxd61 port mode (pm11) output latch (p11) selector ti001 input p05/ti001 port input switch control (isc2) 0: select ti001 (p05) 1: select rxd61 (p11) port mode (pm05) output latch (p05) selector selector intp1 input p30/intp1 port input switch control (isc4) 0: select intp1 (p30) 1: select rxd61 (p11) port mode (pm30) output latch4 (p30) selector selector remark isc2, isc4: bits 2 and 4 of the input switch control register (isc) (see figure 14-20 ) the peripheral functions used in the lin communication operation are shown below. ? external interrupt (intp1); wakeup signal detection use: detects the wakeup signal edges and detects start of communication. ? 16-bit timer/event counter 00 (ti001); baud rate error detection use: detects the baud rate error (meas ures the ti001 input edge interval in the capture mode) by detecting the sync field (sf) length and divides it by the number of bits. ? serial interface uart61.
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 384 14.2 configurations of seri al interface uart60 and uart61 serial interfaces uart60 and uart61 include the following hardware. table 14-1. configurations of serial interface uart60 and uart61 item configuration registers receive buffer register 6n (rxb6n) receive shift register 6n (rxs6n) transmit buffer register 6n (txb6n) transmit shift register 6n (txs6n) control registers asynchronous serial interface operation mode register 6n (asim6n) asynchronous serial interface recepti on error status register 6n (asis6n) asynchronous serial interface transm ission status register 6n (asif6n) clock selection register 6n (cksr6n) baud rate generator control register 6n (brgc6n) asynchronous serial interface control register 6n (asicl6n) input switch control register (isc) port mode register 1 (pm1) port register 1 (p1) remark n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 385 figure 14-6. block diagram of serial interface uart60 ti010, intp0 internal bus asynchronous serial interface control register 60 (asicl60) transmit buffer register 60 (txb60) transmit shift register 60 (txs60) t x d60/p13 intst60 baud rate generator asynchronous serial interface control register 60 (asicl60) reception control receive shift register 60 (rxs60) receive buffer register 60 (rxb60) r x d60/p14 intsr60 baud rate generator filter intsre60 asynchronous serial interface reception error status register 60 (asis60) asynchronous serial interface operation mode register 60 (asim60) asynchronous serial interface transmission status register 60 (asif60) transmission control registers f prs f prs /2 f prs /2 2 f prs /2 3 f prs /2 4 f prs /2 5 f prs /2 6 f prs /2 7 f prs /2 8 f prs /2 9 f prs /2 10 8-bit timer/ event counter 50 output 8 reception unit transmission unit clock selection register 60 (cksr60) baud rate generator control register 60 (brgc60) pm13 8 selector output latch p13 note selectable with input switch control register (isc)
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 386 figure 14-7. block diagram of serial interface uart61 internal bus asynchronous serial interface control register 61 (asicl61) transmit buffer register 61 (txb61) transmit shift register 61 (txs61) t x d61/p10/sck10 intst61 baud rate generator asynchronous serial interface control register 61 (asicl61) reception control receive shift register 61 (rxs61) receive buffer register 61 (rxb61) r x d61/p11/si10 intsr61 baud rate generator filter intsre61 asynchronous serial interface reception error status register 61 (asis61) asynchronous serial interface operation mode register 61 (asim61) asynchronous serial interface transmission status register 61 (asif61) transmission control registers f prs f prs /2 f prs /2 2 f prs /2 3 f prs /2 4 f prs /2 5 f prs /2 6 f prs /2 7 f prs /2 8 f prs /2 9 f prs /2 10 8-bit timer/ event counter 50 output 8 reception unit transmission unit clock selection register 61 (cksr61) baud rate generator control register 61 (brgc61) pm10 8 selector output latch p10
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 387 (1) receive buffer register 6n (rxb6n) this 8-bit register stores parallel data conv erted by receive shift register 6n (rxs6n). each time 1 byte of data has been received, new receive da ta is transferred to this register from rxs6n. if the data length is set to 7 bits, data is transferred as follows. ? in lsb-first reception, the receive data is transferred to bits 0 to 6 of rxb6n and the msb of rxb6n is always 0. ? in msb-first reception, the receive data is transferred to bits 1 to 7 of rxb6n and the lsb of rxb6n is always 0. if an overrun error (ove6n) occurs, the rece ive data is not transferred to rxb6n. rxb6n can be read by an 8-bit memory manipulation inst ruction. no data can be written to this register. reset signal generation sets this register to ffh. (2) receive shift register 6n (rxs6n) this register converts the serial data input to the r x d6n pins into parallel data. rxs6n cannot be directly manipulated by a program. (3) transmit buffer register 6n (txb6n) this buffer register is used to set transmit data. tr ansmission is started when data is written to txb6n. this register can be read or written by an 8-bit memory manipulation instruction. reset signal generation sets this register to ffh. cautions 1. do not write data to txb6n when bit 1 (txbf6n) of asynchronous serial interface transmission status register 6n (asif6n) is 1. 2. do not refresh (write the same value to) txb6n by software during a communication operation (when bits 7 and 6 (power6n, txe6n) of asynchronous serial interface operation mode register 6n (asim6n) are 1 or when bits 7 and 5 (power6n, rxe6n) of asim6n are 1). 3. set transmit data to txb6n at least one base clock (f xclk6 ) after setting txe6n = 1. (4) transmit shift register 6n (txs6n) this register transmits the data transferred from txb6n fr om the txd6n pins as serial data. data is transferred from txb6n immediately after txb6n is written for the first transmission, or immediately before intst6n occurs after one frame was transmitted for continuous transmiss ion. data is transferred from txb6n and transmitted from the t x d6n pins at the falling edge of the base clock. txs6n cannot be directly manipulated by a program. remark n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 388 14.3 registers controlling serial interfaces uart60 and uart61 serial interfaces uart60 and uart61 are cont rolled by the following nine registers. ? asynchronous serial interface operat ion mode register 6n (asim6n) ? asynchronous serial interface recepti on error status register 6n (asis6n) ? asynchronous serial interface transmi ssion status register 6n (asif6n) ? clock selection register 6n (cksr6n) ? baud rate generator control register 6n (brgc6n) ? asynchronous serial interface control register 6n (asicl6n) ? input switch control register (isc) ? port mode register 1 (pm1) ? port register 1 (p1) (1) asynchronous serial interface operation mode register 6n (asim6n) this 8-bit register controls the serial communica tion operations of serial interface uart60 and uart61. this register can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation sets this register to 01h. remarks 1. asim6n can be refreshed (the same value is written) by software during a communication operation (when bits 7 and 6 (power6n, txe6n) of asim6n = 1 or bits 7 and 5 (power6n, rxe6n) of asim6n = 1). 2. n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 389 figure 14-8. format of asynchronous serial interf ace operation mode register 60 (asim60) (1/2) address: ff2eh after reset: 01h r/w symbol <7> <6> <5> 4 3 2 1 0 asim60 power60 txe60 rxe60 ps610 ps600 cl60 sl60 isrm60 power60 enables/disables operati on of internal operation clock 0 note 1 disables operation of the internal operation clock (fixes the clock to low level) and asynchronously resets the internal circuit note 2 . 1 enables operation of the internal operation clock txe60 enables/disables transmission 0 disables transmission (synchronous ly resets the transmission circuit). 1 enables transmission rxe60 enables/disables reception 0 disables reception (synchronous ly resets the reception circuit). 1 enables reception notes 1. if power60 = 0 is set while transmitting data, the output of the txd60 pin will be fixed to high level (if txdlv60 = 0). furthermore, the input from the rxd60 pin will be fixed to high level. 2. asynchronous serial interface reception error st atus register 60 (asis60), asynchronous serial interface transmission status register 60 (asif60), bit 7 (sbrf60) and bit 6 (sbrt60) of asynchronous serial interface control register 60 (asicl60), and receive buffer register 60 (rxb60) are reset.
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 390 figure 14-8. format of asynchronous serial interf ace operation mode register 60 (asim60) (2/2) ps610 ps600 transmission operat ion reception operation 0 0 does not output parity bit. reception without parity 0 1 outputs 0 parity. reception as 0 parity note 1 0 outputs odd parity. judges as odd parity. 1 1 outputs even parity. judges as even parity. cl60 specifies character l ength of transmit/receive data 0 character length of data = 7 bits 1 character length of data = 8 bits sl60 specifies number of stop bits of transmit data 0 number of stop bits = 1 1 number of stop bits = 2 isrm60 enables/disables occurr ence of reception completion interrupt in case of error 0 ?intsre60? occurs in case of error (at this time, intsr60 does not occur). 1 ?intsr60? occurs in case of error (at this time, intsre60 does not occur). note if ?reception as 0 parity? is selected, the parity is not judged. therefore, bit 2 (pe60) of asynchronous serial interface reception error status r egister 60 (asis60) is not set and t he error interrupt does not occur. cautions 1. to start the transmission, set power 60 to 1 and then set txe60 to 1. to stop the transmission, clear txe60 to 0, and then clear power60 to 0. 2. to start the reception, set power60 to 1 and then set rxe60 to 1. to stop the reception, clear rxe60 to 0, and then clear power60 to 0. 3. set power60 to 1 and then set rxe60 to 1 while a high level is input to the rxd60 pins. if power60 is set to 1 and rxe60 is set to 1 wh ile a low level is input, reception is started. 4. txe60 and rxe60 are synchronized by the base clock (f xclk6 ) set by cksr60. to enable transmission or reception again, set txe60 or rxe60 to 1 at least two clocks of the base clock after txe60 or rxe60 has been cleared to 0. if txe60 or rxe60 is set within two clocks of the base clock, the transmission circuit or reception circuit may not be initialized. 5. set transmit data to txb60 at least one base clock (f xclk6 ) after setting txe60 = 1. 6. clear the txe60 and rxe60 bits to 0 be fore rewriting the ps610, ps600, and cl60 bits. 7. fix the ps610 and ps600 bits to 0 when used in lin communication operation. 8. clear txe60 to 0 before rewriting the sl60 bit. reception is always performed with ?the number of stop bits = 1?, and therefore, is not affected by the set value of the sl60 bit. 9. make sure that rxe60 = 0 when rewriting the isrm60 bit.
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 391 figure 14-9. format of asynchronous serial interf ace operation mode register 61 (asim61) (1/2) address: ff2fh after reset: 01h r/w symbol <7> <6> <5> 4 3 2 1 0 asim61 power61 txe61 rxe61 ps611 ps601 cl61 sl61 isrm61 power61 enables/disables operati on of internal operation clock 0 note 1 disables operation of the internal operation clock (fixes the clock to low level) and asynchronously resets the internal circuit note 2 . 1 enables operation of the internal operation clock txe61 enables/disables transmission 0 disables transmission (synchronous ly resets the transmission circuit). 1 enables transmission rxe61 enables/disables reception 0 disables reception (synchronous ly resets the reception circuit). 1 enables reception notes 1. if power61 = 0 is set while transmitting data, the output of the txd61 pin will be fixed to high level (if txdlv61 = 0). furthermore, the input from the rxd61 pin will be fixed to high level. 2. asynchronous serial interface reception error status register 61 (asis61), asynchronous serial interface transmission status register 61 (asif61), bit 7 ( sbrf61) and bit 6 (sbrt61) of asynchronous serial interface control register 61 (asicl61), and re ceive buffer register 61 (rxb61) are reset.
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 392 figure 14-9. format of asynchronous serial interf ace operation mode register 61 (asim61) (2/2) ps611 ps601 transmission operat ion reception operation 0 0 does not output parity bit. reception without parity 0 1 outputs 0 parity. reception as 0 parity note 1 0 outputs odd parity. judges as odd parity. 1 1 outputs even parity. judges as even parity. cl61 specifies character l ength of transmit/receive data 0 character length of data = 7 bits 1 character length of data = 8 bits sl61 specifies number of stop bits of transmit data 0 number of stop bits = 1 1 number of stop bits = 2 isrm61 enables/disables occurr ence of reception completion interrupt in case of error 0 ?intsre61? occurs in case of error (at this time, intsr61 does not occur). 1 ?intsr61? occurs in case of error (at this time, intsre61 does not occur). note if ?reception as 0 parity? is selected, the parity is not judged. therefore, bit 2 (pe61) of asynchronous serial interface reception error status r egister 61 (asis61) is not set and t he error interrupt does not occur. cautions 1. to start the transmission, set power 61 to 1 and then set txe61 to 1. to stop the transmission, clear txe61 to 0, and then clear power61 to 0. 2. to start the reception, set power61 to 1 and then set rxe61 to 1. to stop the reception, clear rxe61 to 0, and then clear power61 to 0. 3. set power61 to 1 and then set rxe61 to 1 while a high level is input to the rxd61 pins. if power61 is set to 1 and rxe61 is set to 1 wh ile a low level is input, reception is started. 4. txe61 and rxe61 are synchronized by the base clock (f xclk6 ) set by cksr61. to enable transmission or reception again, set txe61 or rxe61 to 1 at least two clocks of the base clock after txe61 or rxe61 has been cleared to 0. if txe61 or rxe61 is set within two clocks of the base clock, the transmission circuit or reception circuit may not be initialized. 5. set transmit data to txb61 at least one base clock (f xclk6 ) after setting txe61 = 1. 6. clear the txe61 and rxe61 bits to 0 be fore rewriting the ps611, ps601, and cl61 bits. 7. fix the ps611 and ps601 bits to 0 when used in lin communication operation. 8. clear txe61 to 0 before rewriting the sl61 bit. reception is always performed with ?the number of stop bits = 1?, and therefore, is not affected by the set value of the sl61 bit. 9. make sure that rxe61 = 0 when rewriting the isrm61 bit.
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 393 (2) asynchronous serial interface reception error status register 6n (asis6n) this register indicates an error status on completion of reception by serial interfaces uart60 and uart61. it includes three error flag bits (pe6n, fe6n, ove6n). this register is read-only by an 8-bit memory manipulation instruction. reset signal generation, or clearing bit 7 (power6n) or bi t 5 (rxe6n) of asim6n to 0 clears this register to 00h. 00h is read when this register is read. if a receptio n error occurs, read asis6n and then read receive buffer register 6n (rxb6n) to clear the error flag. remark n = 0, 1 figure 14-10. format of asynchronous serial interf ace reception error status register 60 (asis60) address: ff53h after reset: 00h r symbol 7 6 5 4 3 2 1 0 asis60 0 0 0 0 0 pe60 fe60 ove60 pe60 status flag indicating parity error 0 if power60 = 0 and rxe60 = 0, or if asis60 register is read 1 if the parity of transmit data does not matc h the parity bit on completion of reception fe60 status flag indicating framing error 0 if power60 = 0 and rxe60 = 0, or if asis60 register is read 1 if the stop bit is not detected on completion of reception ove60 status flag indicating overrun error 0 if power60 = 0 and rxe60 = 0, or if asis60 register is read 1 if receive data is set to the rxb60 register and t he next reception operation is completed before the data is read. cautions 1. the operation of the pe60 bit differs depending on the set values of the ps610 and ps600 bits of asynchronous serial interface ope ration mode register 60 (asim60). 2. the first bit of the receive data is checked as the stop bit, regardless of the number of stop bits. 3. if an overrun error occurs, the next receive data is not written to receive buffer register 60 (rxb60) but discarded. 4. if data is read from asis60, a wait cycle is generated. do not read data from asis60 when the cpu is operating on the subsystem clock and th e high-speed system clock is stopped. for details, see chapter 31 cautions for wait.
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 394 figure 14-11. format of asynchronous serial interf ace reception error status register 61 (asis61) address: ff2fh after reset: 00h r symbol 7 6 5 4 3 2 1 0 asis61 0 0 0 0 0 pe61 fe61 ove61 pe61 status flag indicating parity error 0 if power61 = 0 and rxe61 = 0, or if asis61 register is read 1 if the parity of transmit data does not matc h the parity bit on completion of reception fe61 status flag indicating framing error 0 if power61 = 0 and rxe61 = 0, or if asis61 register is read 1 if the stop bit is not detected on completion of reception ove61 status flag indicating overrun error 0 if power61 = 0 and rxe61 = 0, or if asis61 register is read 1 if receive data is set to the rxb61 register and t he next reception operation is completed before the data is read. cautions 1. the operation of the pe61 bit differs depending on the set values of the ps611 and ps601 bits of asynchronous serial interface ope ration mode register 61 (asim61). 2. the first bit of the receive data is checked as the stop bit, regardless of the number of stop bits. 3. if an overrun error occurs, the next receive data is not written to receive buffer register 61 (rxb61) but discarded. 4. if data is read from asis61, a wait cycle is generated. do not read data from asis6 when the cpu is operating on the subsystem clock and th e high-speed system clock is stopped. for details, see chapter 31 cautions for wait.
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 395 (3) asynchronous serial interface transmission status register 6n (asif6n) this register indicates the status of transmission by se rial interfaces uart60 and uart61. it includes two status flag bits (txbf6n and txsf6n). transmission can be continued without disruption even during an interrupt period, by writing the next data to the txb6n register after data has been transferred from the txb6n register to the txs6n register. this register is read-only by an 8-bit memory manipulation instruction. reset signal generation, or clearing bit 7 (power6n) or bi t 6 (txe6n) of asim6n to 0 clears this register to 00h. remark n = 0, 1 figure 14-12. format of asynchronous serial inte rface transmission status register 60 (asif60) address: ff55h after reset: 00h r symbol 7 6 5 4 3 2 1 0 asif60 0 0 0 0 0 0 txbf60 txsf60 txbf60 transmit buffer data flag 0 if power60 = 0 or txe60 = 0, or if data is transferred to transmit shift register 60 (txs60) 1 if data is written to transmit buffer regi ster 60 (txb60) (if data exists in txb60) txsf60 transmit shift register data flag 0 if power60 = 0 or txe60 = 0, or if the next data is not transferred from transmit buffer register 60 (txb60) after completion of transfer 1 if data is transferred from transmit buffer register 60 (txb60) (if data trans mission is in progress) cautions 1. to transmit data continuously, write the fi rst transmit data (first byte ) to the txb60 register. be sure to check that the txbf60 fl ag is ?0?. if so, write the next transmit da ta (second byte) to the txb60 register. if data is written to th e txb60 register while the txbf60 flag is ?1?, the transmit data cannot be guaranteed. 2. to initialize the transmission unit upon completion of continuous transmission, be sure to check that the txsf60 flag is ?0? after generation of the transmission completion interrupt, and then execute initialization. if initializati on is executed while the txsf60 flag is ?1?, the transmit data cannot be guaranteed.
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 396 figure 14-13. format of asynchronous serial inte rface transmission status register 61 (asif61) address: ff38h after reset: 00h r symbol 7 6 5 4 3 2 1 0 asif61 0 0 0 0 0 0 txbf61 txsf61 txbf61 transmit buffer data flag 0 if power61 = 0 or txe61 = 0, or if data is transferred to transmit shift register 61 (txs61) 1 if data is written to transmit buffer regi ster 61 (txb61) (if data exists in txb61) txsf61 transmit shift register data flag 0 if power61 = 0 or txe61 = 0, or if the next data is not transferred from transmit buffer register 61 (txb61) after completion of transfer 1 if data is transferred from transmit buffer register 61 (txb61) (if data trans mission is in progress) cautions 1. to transmit data continuously, write the fi rst transmit data (first byte ) to the txb61 register. be sure to check that the txbf61 fl ag is ?0?. if so, write the next transmit da ta (second byte) to the txb61 register. if data is written to th e txb61 register while the txbf61 flag is ?1?, the transmit data cannot be guaranteed. 2. to initialize the transmission unit upon completion of continuous transmission, be sure to check that the txsf61 flag is ?0? after generation of the transmission completion interrupt, and then execute initialization. if initializati on is executed while the txsf61 flag is ?1?, the transmit data cannot be guaranteed.
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 397 (4) clock selection register 6n (cksr6n) this register selects the base clocks of serial interface uart60 and uart61. cksr6n can be set by an 8-bit memory manipulation instruction. reset signal generation sets this register to 00h. remarks 1. cksr6n can be refreshed (the same value is wr itten) by software during a communication operation (when bits 7 and 6 (power6n, txe6n) of asim6n = 1 or bits 7 and 5 (power6n, rxe6n) of asim6n = 1). 2. n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 398 figure 14-14. format of clock selection register 60 (cksr60) address: ff56h after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 cksr60 0 0 0 0 tps630 tps620 tps610 tps600 base clock (f xclk6 ) selection note 1 tps630 tps620 tps610 tps600 f prs = 4 mhz f prs = 5 mhz f prs = 10 mhz f prs = 20 mhz 0 0 0 0 f prs note 2 4 mhz 5 mhz 10 mhz note 3 20 mhz note 3 0 0 0 1 f prs /2 2 mhz 2.5 mhz 5 mhz 10 mhz note 3 0 0 1 0 f prs /2 2 1 mhz 1.25 mhz 2.5 mhz 5 mhz 0 0 1 1 f prs /2 3 500 khz 625 khz 1.25 mhz 2.5 mhz 0 1 0 0 f prs /2 4 250 khz 312.5 khz 625 khz 1.25 mhz 0 1 0 1 f prs /2 5 125 khz 156.25 khz 312.5 khz 625 khz 0 1 1 0 f prs /2 6 62.5 khz 78.13 khz 156.25 khz 312.5 khz 0 1 1 1 f prs /2 7 31.25 khz 39.06 khz 78.13 khz 156.25 khz 1 0 0 0 f prs /2 8 15.625 khz 19.53 khz 39.06 khz 78.13 khz 1 0 0 1 f prs /2 9 7.813 khz 9.77 khz 19.53 khz 39.06 khz 1 0 1 0 f prs /2 10 3.906 khz 4.88 khz 9.77 khz 19.53 khz 1 0 1 1 tm50 output note 4 other than above setting prohibited notes 1. the frequency that can be used for the peripheral hardware clock (f prs ) differs depending on the power supply voltage and product specifications. supply voltage peripheral hardware clock frequency 4.0 v v dd 5.5 v f prs 20 mhz 2.7 v v dd < 4.0 v f prs 10 mhz 1.8 v v dd < 2.7 v ((a) grade products only) f prs 5 mhz (the values shown in the table above are those when f prs = f xh (xsel = 1).) 2. if the peripheral hardware clock (f prs ) operates on the internal high-speed oscillation clock (f rh ) (xsel = 0), when 1.8 v v dd < 2.7 v, the setting of tps630 = tps 620 = tps610 = tps600 = 0 (base clock: f prs ) is prohibited. 3. this is settable only if 2.7 v v dd 5.5 v. 4. this is settable only if 4.0 v v dd 5.5 v. 5. note the following points when select ing the tm50 output as the base clock. ? mode in which the count clock is cleared and st arted upon a match of tm50 and cr50 (tmc506 = 0) start the operation of 8-bit timer/event counter 50 first and then enable the timer f/f inversion operation (tmc501 = 1). ? pwm mode (tmc506 = 1) start the operation of 8-bit timer/event counter 50 fi rst and then set the count clock to make the duty = 50%. it is not necessary to enable the to50 pin as a timer output pin in any mode. caution make sure power60 = 0 when rewriting tps630 to tps600. remarks 1. f prs : peripheral hardware clock frequency 2. tmc506: bit 6 of 8-bit timer mode control register 50 (tmc50) tmc501: bit 1 of tmc50
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 399 figure 14-15. format of clock selection register 61 (cksr61) address: ff39h after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 cksr61 0 0 0 0 tps631 tps621 tps611 tps601 base clock (f xclk6 ) selection note 1 tps631 tps621 tps611 tps601 f prs = 4 mhz f prs = 5 mhz f prs = 10 mhz f prs = 20 mhz 0 0 0 0 f prs note 2 4 mhz 5 mhz 10 mhz note 3 20 mhz note 4 0 0 0 1 f prs /2 2 mhz 2.5 mhz 5 mhz 10 mhz note 3 0 0 1 0 f prs /2 2 1 mhz 1.25 mhz 2.5 mhz 5 mhz 0 0 1 1 f prs /2 3 500 khz 625 khz 1.25 mhz 2.5 mhz 0 1 0 0 f prs /2 4 250 khz 312.5 khz 625 khz 1.25 mhz 0 1 0 1 f prs /2 5 125 khz 156.25 khz 312.5 khz 625 khz 0 1 1 0 f prs /2 6 62.5 khz 78.13 khz 156.25 khz 312.5 khz 0 1 1 1 f prs /2 7 31.25 khz 39.06 khz 78.13 khz 156.25 khz 1 0 0 0 f prs /2 8 15.625 khz 19.53 khz 39.06 khz 78.13 khz 1 0 0 1 f prs /2 9 7.813 khz 9.77 khz 19.53 khz 39.06 khz 1 0 1 0 f prs /2 10 3.906 khz 4.88 khz 9.77 khz 19.53 khz 1 0 1 1 tm50 output note 5 other than above setting prohibited notes 1. the frequency that can be used for the peripheral hardware clock (f prs ) differs depending on the power supply voltage and product specifications. supply voltage peripheral hardware clock frequency 4.0 v v dd 5.5 v f prs 20 mhz 2.7 v v dd < 4.0 v f prs 10 mhz 1.8 v v dd < 2.7 v ((a) grade products only) f prs 5 mhz (the values shown in the table above are those when f prs = f xh (xsel = 1).) 2. if the peripheral hardware clock (f prs ) operates on the internal high-speed oscillation clock (f rh ) (xsel = 0), when 1.8 v v dd < 2.7 v, the setting of tps631 = tps 621 = tps611 = tps601 = 0 (base clock: f prs ) is prohibited. 3. this is settable only if 2.7 v v dd 5.5 v. 4. this is settable only if 4.0 v v dd 5.5 v. 5. note the following points when select ing the tm50 output as the base clock. ? mode in which the count clock is cleared and st arted upon a match of tm50 and cr50 (tmc506 = 0) start the operation of 8-bit timer/event counter 50 first and then enable the timer f/f inversion operation (tmc501 = 1). ? pwm mode (tmc506 = 1) start the operation of 8-bit timer/event counter 50 fi rst and then set the count clock to make the duty = 50%. it is not necessary to enable the to50 pin as a timer output pin in any mode. caution make sure power61 = 0 when rewriting tps631 to tps601. remarks 1. f prs : peripheral hardware clock frequency 2. tmc506: bit 6 of 8-bit timer mode control register 50 (tmc50) tmc501: bit 1 of tmc50
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 400 (5) baud rate generator control register 6n (brgc6n) this register sets the division value of the 8- bit counters of serial interface uart60 and uart61. brgc6n can be set by an 8-bit memory manipulation instruction. reset signal generation sets this register to ffh. remarks 1. brgc6n can be refreshed (the same value is written) by software during a communication operation (when bits 7 and 6 (power6n, txe6n) of asim6n = 1 or bits 7 and 5 (power6n, rxe6n) of asim6n = 1). 2. n = 0, 1 figure 14-16. format of baud rate generator control register 60 (brgc60) address: ff57h after reset: ffh r/w symbol 7 6 5 4 3 2 1 0 brgc60 mdl670 mdl660 mdl650 mdl640 mdl630 mdl620 mdl610 mdl600 mdl670 mdl660 mdl650 mdl640 mdl630 mdl620 mdl610 mdl600 k output clock selection of 8-bit counter 0 0 0 0 0 0 setting prohibited 0 0 0 0 0 1 0 0 4 f xclk6 /4 0 0 0 0 0 1 0 1 5 f xclk6 /5 0 0 0 0 0 1 1 0 6 f xclk6 /6 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 1 1 1 1 1 0 0 252 f xclk6 /252 1 1 1 1 1 1 0 1 253 f xclk6 /253 1 1 1 1 1 1 1 0 254 f xclk6 /254 1 1 1 1 1 1 1 1 255 f xclk6 /255 cautions 1. make sure that bit 6 (txe60) and bit 5 (r xe60) of the asim6n register = 0 when rewriting the mdl670 to mdl600 bits. 2. the baud rate is the output clock of the 8-bit counter divided by 2. remarks 1. f xclk6 : frequency of base clock selected by the tps630 to tps600 bits of cksr60 register 2. k: value set by mdl670 to md l600 bits (k = 4, 5, 6, ..., 255) 3. : don?t care
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 401 figure 14-17. format of baud rate generator control register 61 (brgc61) address: ff3eh after reset: ffh r/w symbol 7 6 5 4 3 2 1 0 brgc61 mdl671 mdl661 mdl651 mdl641 mdl631 mdl621 mdl611 mdl601 mdl671 mdl661 mdl651 mdl641 mdl631 mdl621 mdl611 mdl601 k output clock selection of 8-bit counter 0 0 0 0 0 0 setting prohibited 0 0 0 0 0 1 0 0 4 f xclk6 /4 0 0 0 0 0 1 0 1 5 f xclk6 /5 0 0 0 0 0 1 1 0 6 f xclk6 /6 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 1 1 1 1 1 0 0 252 f xclk6 /252 1 1 1 1 1 1 0 1 253 f xclk6 /253 1 1 1 1 1 1 1 0 254 f xclk6 /254 1 1 1 1 1 1 1 1 255 f xclk6 /255 cautions 1. make sure that bit 6 (txe61) and bit 5 (r xe61) of the asim61 register = 0 when rewriting the mdl671 to mdl601 bits. 2. the baud rate is the output clock of the 8-bit counter divided by 2. remarks 1. f xclk6 : frequency of base clock selected by the tps631 to tps601 bits of cksr61 register 2. k: value set by mdl671 to md l601 bits (k = 4, 5, 6, ..., 255) 3. : don?t care
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 402 (6) asynchronous serial interface control register 6n (asicl6n) this register controls the serial communication op erations of serial interface uart60 and uart61. asicl6n can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation sets this register to 16h. caution asicl6n can be refreshed (the same value is written) by software during a communication operation (when bits 7 and 6 (power6n, txe6n) of asim6n = 1 or bits 7 and 5 (power6n, rxe6n) of asim6n = 1). however, do not set both sbrt6n and sbtt6n to 1 by a refresh operation during sbf reception (sbrt6n = 1) or sbf transmission (until intst6n occurs since sbtt6n has been set (1)), because it may re-trigger sbf reception or sbf transmission. remark n = 0, 1 figure 14-18. format of asynchronous serial interface control register 60 (asicl60) (1/2) address: ff58h after reset: 16h r/w note symbol <7> <6> 5 4 3 2 1 0 asicl60 sbrf60 sbrt60 sbtt60 sbl620 sbl610 sbl600 dir60 txdlv60 sbrf60 sbf reception status flag 0 if power60 = 0 and rxe60 = 0 or if sbf reception has been completed correctly 1 sbf reception in progress sbrt60 sbf reception trigger 0 ? 1 sbf reception trigger sbtt60 sbf transmission trigger 0 ? 1 sbf transmission trigger note bit 7 is read-only.
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 403 figure 14-18. format of asynchronous serial interface control register 60 (asicl60) (2/2) sbl620 sbl610 sbl600 sbf transmission output width control 1 0 1 sbf is output with 13-bit length. 1 1 0 sbf is output with 14-bit length. 1 1 1 sbf is output with 15-bit length. 0 0 0 sbf is output with 16-bit length. 0 0 1 sbf is output with 17-bit length. 0 1 0 sbf is output with 18-bit length. 0 1 1 sbf is output with 19-bit length. 1 0 0 sbf is output with 20-bit length. dir60 first-bit specification 0 msb 1 lsb txdlv60 enables/disables inverting t x d6n output 0 normal output of t x d60 1 inverted output of t x d60 cautions 1. in the case of an sbf reception error, the mode returns to the sbf reception mode. the status of the sbrf60 flag is held (1). 2. before setting the sbrt60 bit, make sure that bit 7 (power60) and bit 5 (rxe60) of asim60 = 1. after setting the sbrt60 bit to 1, do not cl ear it to 0 before sbf reception is completed (before an interrupt request signal is generated). 3. the read value of the sbrt60 bit is always 0. sbrt60 is automatically cleared to 0 after sbf reception has been correctly completed. 4. before setting the sbtt60 bit to 1, make sure that bit 7 (power60) and bit 6 (txe60) of asim60 = 1. after setting the sbtt60 bit to 1, do not clear it to 0 before sbf transmission is completed (before an interrupt request signal is generated). 5. the read value of the sbtt60 bit is always 0. sbtt60 is automatically cleared to 0 at the end of sbf transmission. 6. do not set the sbrt60 bit to 1 during reception, and do not set the sbtt60 bit to 1 during transmission. 7. before rewriting the dir60 and txdlv60 bits, clear the txe60 and rxe60 bits to 0. 8. when the txdlv60 bit is set to 1 (inverted txd60 output), the txd60/p13 pin cannot be used as a general-purpose port, regardless of the settings of power60 and txe60. when using the txd60/p13 pin as a general-purpose port, clear the txdlv60 bit to 0 (normal txd60 output).
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 404 figure 14-19. format of asynchronous serial interface control register 61 (asicl61) (1/2) address: ff3fh after reset: 16h r/w note symbol <7> <6> 5 4 3 2 1 0 asicl61 sbrf61 sbrt61 sbtt61 sbl621 sbl611 sbl601 dir61 txdlv61 sbrf61 sbf reception status flag 0 if power61 = 0 and rxe61 = 0 or if sbf reception has been completed correctly 1 sbf reception in progress sbrt61 sbf reception trigger 0 ? 1 sbf reception trigger sbtt61 sbf transmission trigger 0 ? 1 sbf transmission trigger note bit 7 is read-only.
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 405 figure 14-19. format of asynchronous serial interface control register 61 (asicl61) (2/2) sbl621 sbl611 sbl601 sbf transmission output width control 1 0 1 sbf is output with 13-bit length. 1 1 0 sbf is output with 14-bit length. 1 1 1 sbf is output with 15-bit length. 0 0 0 sbf is output with 16-bit length. 0 0 1 sbf is output with 17-bit length. 0 1 0 sbf is output with 18-bit length. 0 1 1 sbf is output with 19-bit length. 1 0 0 sbf is output with 20-bit length. dir61 first-bit specification 0 msb 1 lsb txdlv61 enables/disables inverting t x d6n output 0 normal output of t x d6n 1 inverted output of t x d6n cautions 1. in the case of an sbf reception error, the mode returns to the sbf reception mode. the status of the sbrf61 flag is held (1). 2. before setting the sbrt61 bit, make sure that bit 7 (power61) and bit 5 (rxe61) of asim61 = 1. after setting the sbrt61 bit to 1, do not cl ear it to 0 before sbf reception is completed (before an interrupt request signal is generated). 3. the read value of the sbrt61 bit is always 0. sbrt61 is automatically cleared to 0 after sbf reception has been correctly completed. 4. before setting the sbtt61 bit to 1, make sure that bit 7 (power61) and bit 6 (txe61) of asim61 = 1. after setting the sbtt61 bit to 1, do not clear it to 0 before sbf transmission is completed (before an interrupt request signal is generated). 5. the read value of the sbtt61 bit is always 0. sbtt61 is automatically cleared to 0 at the end of sbf transmission. 6. do not set the sbrt61 bit to 1 during reception, and do not set the sbtt61 bit to 1 during transmission. 7. before rewriting the dir61 and txdlv61 bits, clear the txe61 and rxe61 bits to 0. 8. when the txdlv61 bit is set to 1 (inverted txd61 output), the txd61/sck10/p10 pin cannot be used as a general-purpose port, regardless of the settings of power61 and txe61. when using the txd61/sck10/p10 pin as a general-purpose port, clear the txdlv61 bit to 0 (normal txd61 output).
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 406 (7) input switch control register (isc) the input switch control register (isc) is used to rece ive a status signal transmitted from the master during lin (local interconnect network) reception. t he input source is switched by setting isc. this register can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears this register to 00h. figure 14-20. format of input switch control register (isc) address: ff4fh after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 isc isc7 0 0 isc4 isc3 isc2 note isc1 isc0 isc7 interrupt source selection 0 intwti 1 intdmu isc4 intp1 input source selection 0 intp1 (p30) 1 rxd61(p11) isc3 intp0 input source selection 0 intp0 (p120) 1 rxd60 (p14) isc2 ti001 input source selection 0 ti001 (p06) 1 rxd61(p11) isc1 ti010 input source selection 0 ti010 (p01) 1 rxd60 (p14) isc0 ti000 input source selection 0 ti000 (p00) 1 tsout note for the 78k0/kc2, be sure to clear to ?0?.
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 407 (8) port mode register 1 (pm1) this register sets port 1 input/output in 1-bit units. when using the p13/txd60 and p10/sck10/txd61 pins fo r serial interface data output, clear pm13 and pm10 to 0 and set the output latch of p13 and p10 to 1. when using the p14/rxd60 and p11/si10/rxd61 in for seri al interface data input, set pm14 and pm11 to 1. the output latch of p14 and p11 at this time may be 0 or 1. pm1 can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation sets this register to ffh. figure 14-21. format of port mode register 1 (pm1) address: ff21h after reset: ffh r/w symbol 7 6 5 4 3 2 1 0 pm1 pm17 pm16 pm15 pm14 pm13 pm12 pm11 pm10 pm1n p1n pin i/o mode selection (n = 0 to 7) 0 output mode (output buffer on) 1 input mode (output buffer off)
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 408 14.4 operations of serial interface uart60 and uart61 serial interfaces uart60 and uart61 have the following two modes. ? operation stop mode ? asynchronous serial interface (uart) mode 14.4.1 operation stop mode in this mode, serial communication cannot be executed; theref ore, the power consumption can be reduced. in addition, the pins can be used as ordinary po rt pins in this mode. to set the operation stop mode, clear bits 7, 6, and 5 (power6n, txe6n, and rxe6n) of asim6n to 0. (1) register used the operation stop mode is set by asynchronous serial interface operation mode register 6n (asim6n). asim6n can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation sets this register to 01h. address: ff50h after reset: 01h r/w symbol <7> <6> <5> 4 3 2 1 0 asim6n power6n txe6n rxe6n ps61n ps60n cl6n sl6n isrm6n power6n enables/disables operati on of internal operation clock 0 note 1 disables operation of the internal operation clock (fixes the clock to low level) and asynchronously resets the internal circuit note 2 . txe6n enables/disables transmission 0 disables transmission operation (synchr onously resets the tr ansmission circuit). rxe6n enables/disables reception 0 disables reception (synchronous ly resets the reception circuit). notes 1. if power6n = 0 is set while transmitting data, the output of the txd6n pin will be fixed to high level (if txdlv6n = 0). furthermore, the input from the rxd6n pin will be fixed to high level. 2. asynchronous serial interface reception error status register 6n (asis6n), asynchronous serial interface transmission status register 6n (asi f6n), bit 7 (sbrf6n) and bit 6 (sbrt6n) of asynchronous serial interface control register 6n (asicl6n), and re ceive buffer register 6n (rxb6n) are reset. caution clear power6n to 0 after clearing txe6n and rxe6n to 0 to stop the operation. to start the communication, set power6n to 1, and then set txe6n and rxe6n to 1. remarks 1. to use the rxd60/p14, rxd 61/p11/si10, txd60/p13 and txd 61/p10/sck10 pins as general- purpose port pins, see chapter 5 port functions . 2. n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 409 14.4.2 asynchronous serial interface (uart) mode in this mode, data of 1 byte is transmitted/received following a start bit, and a full-duplex operation can be performed. a dedicated uart baud rate generator is incorporated, so that communication can be executed at a wide range of baud rates. (1) registers used ? asynchronous serial interface operat ion mode register 6n (asim6n) ? asynchronous serial interface recepti on error status register 6n (asis6n) ? asynchronous serial interface transmi ssion status register 6n (asif6n) ? clock selection register 6n (cksr6n) ? baud rate generator control register 6n (brgc6n) ? asynchronous serial interface control register 6n (asicl6n) ? input switch control register (isc) ? port mode register 1 (pm1) ? port register 1 (p1) the basic procedure of setting an operatio n in the uart mode is as follows. <1> set the cksr6n register (see figure 14-14, 14-15 ). <2> set the brgc6n register (see figure 14-16, 14-17 ). <3> set bits 0 to 4 (isrm6n, sl6n, cl6n, ps60n, ps61n) of the asim6n register (see figure 14-8, 14-9 ). <4> set bits 0 and 1 (txdlv6n, dir 6n) of the asicl6n register (see figure 14-18, 14-19 ). <5> set bit 7 (power6n) of the asim6n register to 1. <6> set bit 6 (txe6n) of the asim6n register to 1. transmission is enabled. set bit 5 (rxe6n) of the asim6n register to 1. reception is enabled. <7> write data to transmit buffer register 6n (txb6n). data transmission is started. caution take relationship with the other party of communication when setting the port mode register and port register. remark n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 410 the relationship between the register settings and pins is shown below. table 14-2. relationship between register settings and pins (a) uart60 pin function power6n txe6n rxe6n pm13 p13 pm14 p14 uart60 operation txd60/p13 rxd60/p14 0 0 0 note note note note stop p13 p14 0 1 note note 1 reception p13 rxd60 1 0 0 1 note note transmission txd60 p14 1 1 1 0 1 1 transmission/ reception txd60 rxd60 (b) uart61 pin function power6n txe6n rxe6n pm10 p10 pm11 p11 uart61 operation txd61/p10/sck61 rxd61/p11/si10 0 0 0 note note note note stop p10 p11 0 1 note note 1 reception p10 rxd61 1 0 0 1 note note transmission txd61 p11 1 1 1 0 1 1 transmission/ reception txd61 rxd61 note can be set as port function. remarks 1. : don?t care power6n: bit 7 of asynchronous serial interface operation mode register 6n (asim6n) txe6n: bit 6 of asim6n rxe6n: bit 5 of asim6n pm1: port mode register p1: port output latch 2. n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 411 (2) communication operation (a) format and waveform example of normal transmit/receive data figures 14-22 and 14-23 show the format and wavefo rm example of the normal transmit/receive data. figure 14-22. format of normal uart transmit/receive data 1. lsb-first transmission/reception start bit parity bit d0 d1 d2 d3 d4 1 data frame character bits d5 d6 d7 stop bit 2. msb-first transmission/reception start bit parity bit d7 d6 d5 d4 d3 1 data frame character bits d2 d1 d0 stop bit one data frame consists of the following bits. ? start bit ... 1 bit ? character bits ... 7 or 8 bits ? parity bit ... even parity, odd parity, 0 parity, or no parity ? stop bit ... 1 or 2 bits the character bit length, parity, and stop bit length in one data frame are specified by asynchronous serial interface operation mode register 6n (asim6n). whether data is communicated with the lsb or msb first is specified by bit 1 (dir6n) of asynchronous serial interface control register 6n (asicl6n). whether the t x d6n pins outputs normal or inverted data is s pecified by bit 0 (txdlv6n) of asicl6n. remark n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 412 figure 14-23. example of normal uart transmit/receive data waveform 1. data length: 8 bits, lsb first, parity: even parity, stop bit: 1 bit, communication data: 55h 1 data frame start d0 d1 d2 d3 d4 d5 d6 d7 parity stop 2. data length: 8 bits, msb first, parity: even parity, stop bit: 1 bit, communication data: 55h 1 data frame start d7 d6 d5 d4 d3 d2 d1 d0 parity stop 3. data length: 8 bits, msb first, parity: even parity, stop bit: 1 bit, communication data: 55h, t x d6n pin inverted output 1 data frame start d7 d6 d5 d4 d3 d2 d1 d0 parity stop 4. data length: 7 bits, lsb first, parity: odd parity, stop bit: 2 bits, communication data: 36h 1 data frame start d0 d1 d2 d3 d4 d5 d6 parity stop stop 5. data length: 8 bits, lsb first, parity: none, stop bit: 1 bit, communication data: 87h 1 data frame start d0 d1 d2 d3 d4 d5 d6 d7 stop remark n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 413 (b) parity types and operation the parity bit is used to detect a bit error in communicati on data. usually, the same type of parity bit is used on both the transmission and reception sides. with even parity and odd parity, a 1-bit (odd number) error can be detected. with zero parity and no parity, an error cannot be detected. caution fix the ps61n and ps60n bits to 0 when the device is used in lin communication operation. (i) even parity ? transmission transmit data, including the parity bit, is controlled so that the number of bits that are ?1? is even. the value of the parity bit is as follows. if transmit data has an odd number of bits that are ?1?: 1 if transmit data has an even number of bits that are ?1?: 0 ? reception the number of bits that are ?1? in the receive dat a, including the parity bit, is counted. if it is odd, a parity error occurs. (ii) odd parity ? transmission unlike even parity, transmit data, including the parity bit, is controlled so that the number of bits that are ?1? is odd. if transmit data has an odd number of bits that are ?1?: 0 if transmit data has an even number of bits that are ?1?: 1 ? reception the number of bits that are ?1? in the receive data, including the parit y bit, is counted. if it is even, a parity error occurs. (iii) 0 parity the parity bit is cleared to 0 when data is transmitted, regardless of the transmit data. the parity bit is not detected when the data is received. therefore, a parity error does not occur regardless of whether the par ity bit is ?0? or ?1?. (iv) no parity no parity bit is appended to the transmit data. reception is performed assuming t hat there is no parity bit when data is received. because there is no parity bit, a parity error does not occur. remark n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 414 (c) normal transmission when bit 7 (power6n) of asynchronous serial interface operation mode register 6n (asim6n) is set to 1 and bit 6 (txe6n) of asim6n is then set to 1, transmissi on is enabled. transmission can be started by writing transmit data to transmit buffer register 6n (txb6n). the start bit, parity bit, and stop bit are automatically appended to the data. when transmission is started, the data in txb6n is transf erred to transmit shift register 6n (txs6n). after that, the transmit data is sequentia lly output from txs6n to the t x d6n pins. when transmission is completed, the parity and stop bits set by asim6n are appended and a transmission completion interrupt request (intst6n) is generated. transmission is stopped until the data to be tr ansmitted next is written to txb6n. figure 14-24 shows the timing of the transmission comp letion interrupt request (intst6n). this interrupt occurs as soon as the last stop bit has been output. figure 14-24. normal transmission completion interrupt request timing 1. stop bit length: 1 intst6n d0 start d1 d2 d6 d7 stop t x d6n (output) parity 2. stop bit length: 2 t x d6n (output) intst6n d0 start d1 d2 d6 d7 parity stop remark n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 415 (d) continuous transmission the next transmit data can be written to transmit buffer r egister 6n (txb6n) as soon as transmit shift register 6 (txs6n) has started its shift operat ion. consequently, even while the intst6n interrupt is being serviced after transmission of one data frame, data can be co ntinuously transmitted and an efficient communication rate can be realized. in addition, the txb6n register c an be efficiently written twice (2 bytes) without having to wait for the transmission time of one data frame, by reading bit 0 (txsf6n) of asynchronous serial interface transmission status register 6n (asif6n) when the transmission completion interrupt has occurred. to transmit data continuously, be sure to reference the asif6n register to check the transmission status and whether the txb6n register can be written, and then write the data. cautions 1. the txbf6n and txsf6n flags of the as if6n register change from ?10? to ?11?, and to ?01? during continuous transmission. to check the status, therefore, do not use a combination of the txbf6n and txsf6n flags for judgment. read only the txbf6n flag when executing continuous transmission. 2. when the device is used in lin communication operation, the continuous transmission function cannot be used. m ake sure that asynchronous serial interface transmission status register 6n (asif6n) is 00h before writing transmit data to transmit buffer register 6n (txb6n). txbf6n writing to txb6 register 0 writing enabled 1 writing disabled caution to transmit data continuously, write the first transmit data (first byte) to the txb6n register. be sure to check that the txbf6n flag is ?0?. if so, write the next transmit data (second byte) to the txb6n register. if data is written to the txb6n register while the txbf6n flag is ?1?, the transmit data cannot be guaranteed. the communication status can be checked using the txsf6n flag. txsf6n transmission status 0 transmission is completed. 1 transmission is in progress. cautions 1. to initialize the transmission unit upon completion of continuous transmission, be sure to check that the txsf6n flag is ?0? after generation of the transmission completion interrupt, and then execute initialization. if initialization is executed while the txsf6n flag is ?1?, the transmit data cannot be guaranteed. 2. during continuous transmission, an overrun error may occur, which means that the next transmission was completed before execution of intst6n interrupt servicing after transmission of one data frame. an overrun error can be detected by developing a program that can count the number of transmit data and by referencing the txsf6n flag. remark n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 416 figure 14-25 shows an example of the continuous transmission processing flow. figure 14-25. example of continuous transmission processing flow write txb6n. set registers. write txb6n. transfer executed necessary number of times? yes read asif6n txbf6n = 0? no no yes transmission completion interrupt occurs? read asif6n txsf6n = 0? no no no yes yes yes yes completion of transmission processing transfer executed necessary number of times? remark txb6n: transmit buffer register 6n asif6n: asynchronous serial interfac e transmission status register 6n txbf6n: bit 1 of asif6n (transmit buffer data flag) txsf6n: bit 0 of asif6n (transmit shift register data flag) n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 417 figure 14-26 shows the timing of st arting continuous transmission, and figure 14-26 shows the timing of ending continuous transmission. figure 14-26. timing of starting continuous transmission t x d6n start intst6n data (1) data (1) data (2) data (3) data (2) data (1) data (3) ff ff parity stop data (2) parity stop txb6n txs6n txbf6n txsf6n start start note note when asif6n is read, there is a period in which txbf6n and txsf6n = 1, 1. therefore, judge whether writing is enabled using only the txbf6n bit. remark t x d6n: txd6n pins (output) intst6n: interrupt request signal txb6n: transmit buffer register 6n txs6n: transmit shift register 6n asif6n: asynchronous serial interfac e transmission status register 6n txbf6n: bit 1 of asif6n txsf6n: bit 0 of asif6n n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 418 figure 14-27. timing of ending continuous transmission t x d6n start intst6n data (n ? 1) data (n ? 1) data (n) data (n) data (n ? 1) ff parity stop stop data (n) parity stop txb6n txs6n txbf6n txsf6n power6n or txe6n start remark t x d6n: t x d6n pins (output) intst6n: interrupt request signal txb6n: transmit buffer register 6n txs6n: transmit shift register 6n asif6n: asynchronous serial interfac e transmission status register 6n txbf6n: bit 1 of asif6n txsf6n: bit 0 of asif6n power6n: bit 7 of asynchronous serial interface operation mode register (asim6n) txe6n: bit 6 of asynchronous serial in terface operation mode register (asim6n) n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 419 (e) normal reception reception is enabled and the r x d6n pins input is sampled when bit 7 (power6n) of asynchronous serial interface operation mode register 6n (asim6n) is set to 1 and then bit 5 (rxe6n) of asim6n is set to 1. the 8-bit counter of the baud ra te generator starts counting when the falling edge of the r x d6n pins input is detected. when the set value of baud rate generator control register 6n (brgc6n) has been counted, the r x d6n pins input is sampled again ( in figure 14-28). if the r x d6n pins are low level at this time, it is recognized as a start bit. when the start bit is detected, receptio n is started, and serial data is sequ entially stored in the receive shift register 6n (rxs6n) at the set baud rate. when the st op bit has been received, the reception completion interrupt (intsr6n) is generated and t he data of rxs6n is written to receive buffer register 6n (rxb6n). if an overrun error (ove6n) occurs, however, t he receive data is not written to rxb6n. even if a parity error (pe6n) occurs while reception is in progress, reception c ontinues to the reception position of the stop bit, and an error interrupt (intsr6n /intsre6n) is generated on completion of reception. figure 14-28. reception completion interrupt request timing r x d6n (input) intsr6n start d0 d1 d2 d3 d4 d5 d6 d7 parity rxb6n stop cautions 1. if a reception error occurs, read asis6n and then rxb6n to clear the error flag. otherwise, an overrun error will occur when the next data is received, and the reception error status will persist. 2. reception is always performed with th e ?number of stop bits = 1?. the second stop bit is ignored. 3. be sure to read asynchronous serial interface reception error status register 6n (asis6n) before reading rxb6n. remark n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 420 (f) reception error three types of errors may occur during reception: a parity error, framing error, or ov errun error. if the error flag of asynchronous serial interface reception error st atus register 6n (asis6n) is set as a result of data reception, a reception error interrupt r equest (intsr6n/intsre6n) is generated. which error has occurred during reception can be id entified by reading the contents of asis6n in the reception error interrupt (intsr6n/intsre6n) servicing (see figure 14-10, 14-11 ). the contents of asis6n are cleared to 0 when asis6n is read. table 14-3. cause of reception error reception error cause parity error the parity specified for transmission does not match the parity of the receive data. framing error stop bit is not detected. overrun error reception of the next data is completed before data is read from receive buffer register 6n (rxb6n). the error interrupt can be separated into reception completion interrupt (intsr6n) and error interrupt (intsre6n) by clearing bit 0 (isrm6n) of asynchr onous serial interface operation mode register 6n (asim6n) to 0. figure 14-29. reception error interrupt 1. if isrm6n is cleared to 0 (reception completion interrupt (intsr6n) and e rror interrupt (intsre6n) are separated) (a) no error during reception (b) error during reception intsr6n intsre6n intsr6n intsre6n 2. if isrm6n is set to 1 (error interrupt is incl uded in intsr6n) (a) no error during reception (b) error during reception intsre6n intsr6n intsre6n intsr6n remark n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 421 (g) noise filter of receive data the rxd6n signal?s is sampled with the bas e clock output by the prescaler block. if two sampled values are the same, the output of t he match detector changes, and the data is sampled as input data. because the circuit is configured as shown in figure 14- 30, the internal processing of the reception operation is delayed by two clocks from the external signal status. figure 14-30. noise filter circuit internal signal b internal signal a match detector in base clock r x d60/p14 rxd61/p11si10 q in ld_en q remark n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 422 (h) sbf transmission when the device is used in lin communication operation, the sbf (synch break field) transmission control function is used for transmission. for the transmission operation of lin, see figure 14-1 lin transmission operation . when bit 7 (power6n) of asynchronous serial interface operation mode register 6n (asim6n) is set to 1 and bit 6 (txe6n) of asim6n is then set to 1, transmission is enabled. sbf transmission can be started by setting bit 5 (sbtt6n) of asynchronous serial interface control register 6n (asicl6n) to 1. thereafter, a low level of bits 13 to 20 (set by bi ts 4 to 2 (sbl62n to sbl60n) of asicl6n) is output. following the end of sbf transmission, the transmiss ion completion interrupt request (intst6n) is generated and sbtt6n is automatically cleared. thereafter, the normal transmission mode is restored. transmission is suspended until the data to be transmi tted next is written to transmit buffer register 6n (txb6n), or until sbtt6n is set to 1. remark n = 0, 1 figure 14-31. sbf transmission t x d6n intst6n sbtt6n 1 2 3 4 5 6 7 8 9 10 11 12 13 stop remark t x d6n: t x d6n pins (output) intst6n: transmission completion interrupt request sbtt6n: bit 5 of asynchronous serial interface control register 6n (asicl6n) n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 423 (i) sbf reception when the device is used in lin communication operation, the sbf (synch break field) reception control function is used for reception. for the reception operat ion of lin, see figure 14-2 lin reception operation . reception is enabled when bit 7 (power6n) of asynch ronous serial interface operation mode register 6n (asim6n) is set to 1 and then bit 5 (rxe6n) of asim6n is set to 1. sbf reception is enabled when bit 6 (sbrt6n) of asynchronous serial interface control regist er 6n (asicl6n) is set to 1. in the sbf reception enabled status, the r x d6n pins are sampled and the start bit is det ected in the same manner as the normal reception enable status. when the start bit has been det ected, reception is star ted, and serial data is sequentially stored in the receive shift register 6n (rxs6n) at the set baud rate. when the stop bit is receiv ed and if the width of sbf is 11 bits or more, a reception completion interrupt requ est (intsr6n) is generated as normal processing. at this time, the sbrf6n and sbrt6n bits are automatica lly cleared, and sbf reception ends. detection of errors, such as ove6n, pe6n, and fe6n (bits 0 to 2 of asynchronous serial interface reception error status register 6n (asis6n)) is suppressed, and error detection processing of uart communication is not performed. in addition, data transfer between receive sh ift register 6n (rxs6n) and receive buffer register 6n (rxb6n) is not performed, and the rese t value of ffh is retained. if the width of sbf is 10 bits or less, an interrupt does not occur as error processing after the stop bit has been received, and the sbf reception mode is restored. in this case, the sbrf6n and sbrt6n bits are not cleared. figure 14-32. sbf reception 1. normal sbf reception (stop bit is detected with a width of more than 10.5 bits) r x d6n sbrt6n /sbrf6n intsr6n 1234567891011 2. sbf reception error (stop bit is detected with a width of 10.5 bits or less) r x d6n sbrt6n /sbrf6n intsr6n 12345678910 ?0? remark r x d6n: r x d6n pins (input) sbrt6n: bit 6 of asynchronous serial interface control register 6n (asicl6n) sbrf6n: bit 7 of asicl6n intsr6n: reception completion interrupt request n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 424 14.4.3 dedicated baud rate generator the dedicated baud rate generator consists of a source clock selector and an 8-bit programmable counter, and generates a serial clock for transmission/reception of uart60 and uart61. separate 8-bit counters are provided for transmission and reception. (1) configuration of baud rate generator ? base clock the clock selected by bits 3 to 0 (tps63n to tps60n) of clock selection register 6n (cksr6n) is supplied to each module when bit 7 (power6n) of asynchronous seri al interface operation mode register 6n (asim6n) is 1. this clock is called the base clock and its frequency is called f xclk6 . the base clock is fixed to low level when power6n = 0. ? transmission counter this counter stops operation, cleared to 0, when bit 7 (power6n) or bit 6 (txe6n) of asynchronous serial interface operation mode regi ster 6n (asim6n) is 0. it starts counting when power6n = 1 and txe6n = 1. the counter is cleared to 0 when the first data transmitt ed is written to transmit buffer register 6n (txb6n). if data are continuously transmitted, the counter is cleared to 0 agai n when one frame of data has been completely transmitted. if there is no data to be transmitted next, the count er is not cleared to 0 and continues counting until power6n or txe6n is cleared to 0. ? reception counter this counter stops operation, clear ed to 0, when bit 7 (power6n) or bit 5 (rxe6n) of asynchronous serial interface operation mode regi ster 6n (asim6n) is 0. it starts counting when the start bit has been detected. the counter stops operation afte r one frame has been received, until the next start bit is detected. remark n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 425 figure 14-33. configuration of baud rate generator selector power6n 8-bit counter match detector baud ra te baud rate generator brgc6n: mdl67n to mdl60n 1/2 power6n, txe6n (or rxe6n) cksr6n: tps63n to tps60n f prs f prs /2 f prs /2 2 f prs /2 3 f prs /2 4 f prs /2 5 f prs /2 6 f prs /2 7 f prs /2 8 f prs /2 9 f prs /2 10 8-bit timer/ e vent counter 50 output f xclk6 remark power6n: bit 7 of asynchronous serial in terface operation mode register 6n (asim6n) txe6n: bit 6 of asim6n rxe6n: bit 5 of asim6n cksr6n: clock selection register 6n brgc6n: baud rate generator control register 6n n = 0, 1 (2) generation of serial clock a serial clock can be generated by using clock selecti on register 6n (cksr6n) and baud rate generator control register 6n (brgc6n). select the clock to be input to the 8-bit counter by using bits 3 to 0 (tps63n to tps60n) of cksr6n. bits 7 to 0 (mdl67n to mdl60n) of brgc6n can be used to select the division value of the 8-bit counter. (a) baud rate the baud rate can be calculated by the following expression. ? baud rate = [bps] f xclk6 : frequency of base clock selected by tps63n to tps60n bits of cksr6n register k: value set by mdl67n to mdl60n bits of brgc6n register (k = 4, 5, 6, ..., 255) (b) error of baud rate the baud rate error can be calculated by the following expression. ? error (%) = ? 1 100 [%] actual baud rate (baud rate with error) desired baud rate (correct baud rate) f xclk6 2 k
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 426 cautions 1. keep the baud rate error during transm ission to within the permissible error range at the reception destination. 2. make sure that the baud rate error dur ing reception satisfies the range shown in (4) permissible baud rate range during reception. example : frequency of base clock = 10 mhz = 10,000,000 hz set value of mdl67n to mdl60n bits of brgc6 register = 00100001b (k = 33) target baud rate = 153600 bps baud rate = 10 m/(2 33) = 10000000/(2 33) = 151,515 [bps] error = (151515/153600 ? 1) 100 = ? 1.357 [%] (3) example of setting baud rate table 14-4. set data of baud rate generator f prs = 5.0 mhz f prs = 10.0 mhz f prs = 20.0 mhz baud rate [bps] tps63n, tps60n k calculated value err [%] tps63n, tps60n k calculated value err [%] tps63n, tps60n k calculated value err [%] 300 7h 65 301 0.16 8h 65 301 0.16 9h 65 301 0.16 600 6h 65 601 0.16 7h 65 601 0.16 8h 65 601 0.16 1200 5h 65 1202 0.16 6h 65 1202 0.16 7h 65 1202 0.16 2400 4h 65 2404 0.16 5h 65 2404 0.16 6h 65 2404 0.16 4800 3h 65 4808 0.16 4h 65 4808 0.16 5h 65 4808 0.16 9600 2h 65 9615 0.16 3h 65 9615 0.16 4h 65 9615 0.16 19200 1h 65 19231 0.16 2h 65 19231 0.16 3h 65 19231 0.16 24000 3h 13 24038 0.16 4h 13 24038 0.16 5h 13 24038 0.16 31250 4h 5 31250 0 5h 5 31250 0 6h 5 31250 0 38400 0h 65 38462 0.16 1h 65 38462 0.16 2h 65 38462 0.16 48000 2h 13 48077 0.16 3h 13 48077 0.16 4h 13 48077 0.16 76800 0h 33 75758 ? 1.36 0h 65 76923 0.16 1h 65 76923 0.16 115200 1h 11 113636 ? 1.36 0h 43 116279 0.94 0h 87 114943 ? 0.22 153600 1h 8 156250 1.73 0h 33 151515 ? 1.36 1h 33 151515 ? 1.36 312500 0h 8 312500 0 1h 8 312500 0 2h 8 312500 0 625000 0h 4 625000 0 1h 4 625000 0 2h 4 625000 0 remark tps63n to tps60n: bits 3 to 0 of clock se lection register 6n (cksr6n) (setting of base clock (f xclk6 )) k: value set by mdl67n to mdl60n bits of baud rate generator control register 6n (brgc6n) (k = 4, 5, 6, ..., 255) f prs : peripheral hardware clock frequency err: baud rate error n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 427 (4) permissible baud rate range during reception the permissible error from the baud rate at the trans mission destination during reception is shown below. caution make sure that the baud rate error during reception is within the permissible error range, by using the calculation expression shown below. figure 14-34. permissible baud rate range during reception fl 1 data frame (11 fl) flmin flmax data frame lengtz of uart60 and uart61 start bit bit 0 bit 1 bit 7 parity bit minimum permissible data frame length maximum permissible data frame length stop bit start bit bit 0 bit 1 bit 7 parity bit latch timing stop bit start bit bit 0 bit 1 bit 7 parity bit stop bit as shown in figure 14-34, the latch timing of the re ceive data is determined by the counter set by baud rate generator control register 6n (brgc6n) after the start bit has been detected. if the last data (stop bit) meets this latch timing, the data can be correctly received. assuming that 11-bit data is received, the theoretical values can be calculated as follows. fl = (brate) ? 1 brate: baud rate of uart60 and uart61 k: set value of brgc6n fl: 1-bit data length margin of latch timing: 2 clocks remark n = 0, 1
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 428 minimum permissible data frame length: flmin = 11 fl ? fl = fl therefore, the maximum receivable baud rate at the transmission destination is as follows. brmax = (flmin/11) ? 1 = brate similarly, the maximum permissible data frame length can be calculated as follows. 10 k + 2 21k ? 2 11 2 k 2 k flmax = fl 11 therefore, the minimum receivable baud rate at the transmission destination is as follows. brmin = (flmax/11) ? 1 = brate the permissible baud rate error between uart60 and uart61 and the transmission destination can be calculated from the above minimum and maximum baud rate expressions, as follows. table 14-5. maximum/minimu m permissible baud rate error division ratio (k) maximum perm issible baud rate error minimu m permissible baud rate error 4 +2.33% ? 2.44% 8 +3.53% ? 3.61% 20 +4.26% ? 4.31% 50 +4.56% ? 4.58% 100 +4.66% ? 4.67% 255 +4.72% ? 4.73% remarks 1. the permissible error of reception depends on t he number of bits in one frame, input clock frequency, and division ratio (k). the higher the input clock frequenc y and the higher the division ratio (k), the higher the permissible error. 2. k: set value of brgc6n (n = 0, 1) 22k 21k + 2 flmax = 11 fl ? fl = fl 21k ? 2 20k 20k 21k ? 2 k ? 2 2k 21k + 2 2k
chapter 14 serial interfaces uart60 and uart61 user?s manual u19180ej1v0ud 429 (5) data frame length during continuous transmission when data is continuously transmitted, th e data frame length from a stop bit to the next start bit is extended by two clocks of base clock from the normal value. howeve r, the result of communica tion is not affected because the timing is initialized on the recepti on side when the start bit is detected. figure 14-35. data frame length during continuous transmission start bit bit 0 bit 1 bit 7 parity bit stop bit fl 1 data frame fl fl fl fl fl fl flstp start bit of second byte start bit bit 0 where the 1-bit data length is fl, the stop bit length is flstp, and base clock frequency is f xclk6 , the following expression is satisfied. flstp = fl + 2/f xclk6 therefore, the data frame length during continuous transmission is: data frame length = 11 fl + 2/f xclk6
user?s manual u19180ej1v0ud 430 chapter 15 serial interfaces csi10 and csi11 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 serial interface csi10 serial interface csi11 ? remark : mounted, ? : not mounted 15.1 functions of serial interfaces csi10 and csi11 serial interfaces csi10 and csi11 have the following two modes. ? operation stop mode ? 3-wire serial i/o mode (1) operation stop mode this mode is used when serial communication is not performed and can enable a reduction in the power consumption. for details, see 15.4.1 operation stop mode . (2) 3-wire serial i/o mode (msb/lsb-first selectable) this mode is used to communicate 8-bit data using three lines: a serial clock line (sck1n) and two serial data lines (si1n and so1n). the processing time of data communication can be shor tened in the 3-wire serial i/o mode because transmission and reception can be simultaneously executed. in addition, whether 8-bit data is communicated with the m sb or lsb first can be specified, so this interface can be connected to any device. the 3-wire serial i/o mode is used for connecting periphe ral ics and display controll ers with a clocked serial interface. for details, see 15.4.2 3-wire serial i/o mode . remark n = 0: 78k0/fc2 n = 0, 1: 78k0/fe2, 78k0/ff2
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 431 15.2 configuration of serial interfaces csi10 and csi11 serial interfaces csi10 and csi11 include the following hardware. table 15-1. configuration of serial interfaces csi10 and csi11 item configuration controller transmit controller clock start/stop controller & clock phase controller registers transmit buffer register 1n (sotb1n) serial i/o shift register 1n (sio1n) control registers serial operation mode register 1n (csim1n) serial clock selection register 1n (csic1n) port mode register 1 (pm1) or port mode register 7 (pm7), port mode register 0 (pm0) port register 1 (p1) or port register 7 (p7), port mode register 0 (p0) remark n = 0: 78k0/fc2 n = 0, 1: 78k0/fe2, 78k0/ff2 figure 15-1. block diagram of serial interface csi10 sck10/p10/txd61 internal bus si10/p11/r x d61 intcsi10 f prs /2 f prs /2 2 f prs /2 3 f prs /2 4 f prs /2 5 f prs /2 6 f prs /2 7 transmit buffer register 10 (sotb10) transmit controller clock start/stop controller & clock phase controller serial i/o shift register 10 (sio10) output selector so10/p12 output latch 8 transmit data controller 8 output latch (p12) pm12 selector (a) baud rate generator output latch (p10) pm10 remark (a): so10 output
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 432 figure 15-2. block diagram of serial interface csi11 8 8 internal bus output selector output latch transmit controller clock start/stop controller & clock phase controller so11/p74 intcsi11 transmit buffer register 11 (sotb11) transmit data controller si11/p75 serial i/o shift register 11 (sio11) f prs /2 f prs /2 2 f prs /2 3 f prs /2 4 f prs /2 5 f prs /2 6 f prs /2 7 ssi11 output latch (p74) pm74 selector (a) baud rate generator output latch (p04) pm04 sck11/p76 ssi11 remark (a): so11 output (1) transmit buffer register 1n (sotb1n) this register sets the transmit data. transmission/reception is started by wr iting data to sotb1n when bit 7 (csie 1n) and bit 6 (trmd1n) of serial operation mode register 1n (csim1n) is 1. the data written to sotb1n is converted from paralle l data into serial data by se rial i/o shift register 1n, and output to the serial output pin (so1n). sotb1n can be written or read by an 8- bit memory manipulation instruction. reset signal generation clears this register to 00h. cautions 1. do not access sotb1n when csot1n = 1 (during serial communication). 2. in the slave mode, transmission/reception is started when data is written to sotb11 with a low level input to the ssi11 pin. for deta ils of the transmissi on/reception operation, see 15.4.2 (2) communication operation. (2) serial i/o shift register 1n (sio1n) this is an 8-bit register that converts data from parallel data into serial data and vice versa. this register can be read by an 8-bit memory manipulation instruction. reception is started by reading data fr om sio1n if bit 6 (trmd1n) of serial operation mode register 1n (csim1n) is 0. during reception, the data is read from the serial input pin (si1n) to sio1n. reset signal generation clears this register to 00h. cautions 1. do not access sio1n when csot1n = 1 (during serial communication). 2. in the slave mode, reception is started when data is read from sio11 with a low level input to the ssi11 pin. for details of the recep tion operation, see 15.4.2 (2) communication operation. remark n = 0: 78k0/fc2 n = 0, 1: 78k0/fe2, 78k0/ff2
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 433 15.3 registers controlling seri al interfaces csi10 and csi11 serial interfaces csi10 and csi11 are cont rolled by the following four registers. ? serial operation mode register 1n (csim1n) ? serial clock selection register 1n (csic1n) ? port mode register 1 (pm1) or port mode re gister 7 (pm7), port mode register 0 (pm0) ? port register 1 (p1) or port regist er 7 (p7), port mode register 0(p0) (1) serial operation mode register 1n (csim1n) csim1n is used to select the operation m ode and enable or disable operation. csim1n can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears this register to 00h. remark n = 0: 78k0/fc2 n = 0, 1: 78k0/fe2, 78k0/ff2 figure 15-3. format of serial operation mode register 10 (csim10) address: ff80h after reset: 00h r/w note 1 symbol <7> 6 5 4 3 2 1 0 csim10 csie10 trmd10 0 dir10 0 0 0 csot10 csie10 operation control in 3-wire serial i/o mode 0 disables operation note 2 and asynchronously resets the internal circuit note 3 . 1 enables operation trmd10 note 4 transmit/receive mode control 0 note 5 receive mode (transmission disabled). 1 transmit/receive mode dir10 note 6 first bit specification 0 msb 1 lsb csot10 communication status flag 0 communication is stopped. 1 communication is in progress. notes 1. bit 0 is a read-only bit. 2. to use p10/sck10/t x d61 and p12/so10 as general-purpose ports , set csim10 in the default status (00h). 3. bit 0 (csot10) of csim10 and serial i/o shift register 10 (sio10) are reset. 4. do not rewrite trmd10 when csot10 = 1 (during serial communication). 5. the so10 output (see (a) in figure 15-1 ) is fixed to the low level when trmd10 is 0. reception is started when data is read from sio10. 6. do not rewrite dir10 when csot10 = 1 (during serial communication). caution be sure to clear bit 5 to 0.
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 434 figure 15-4. format of serial operation mode register 11 (csim11) address: ff88h after reset: 00h r/w note 1 symbol <7> 6 5 4 3 2 1 0 csim11 csie11 trmd11 sse11 dir11 0 0 0 csot11 csie11 operation control in 3-wire serial i/o mode 0 disables operation note 2 and asynchronously resets the internal circuit note 3 . 1 enables operation trmd11 note 4 transmit/receive mode control 0 note 5 receive mode (transmission disabled). 1 transmit/receive mode sse11 notes 6, 7 ssi11 pin use selection 0 ssi11 pin is not used 1 ssi11 pin is used dir11 note 8 first bit specification 0 msb 1 lsb csot11 communication status flag 0 communication is stopped. 1 communication is in progress. notes 1. bit 0 is a read-only bit. 2. to use p74/so11, p76/sck11, and p05/ssi11/ti001 as general-pur pose ports, set csim11 in the default status (00h). 3. bit 0 (csot11) of csim11 and serial i/o shift register 11 (sio11) are reset. 4. do not rewrite trmd11 when csot11 = 1 (during serial communication). 5. the so11 output (see (a) in figure 15-2 ) is fixed to the low level when trmd11 is 0. reception is started when data is read from sio11. 6. do not rewrite sse11 when csot11 = 1 (during serial communication). 7. before setting this bit to 1, fix the ssi11 pin input level to 0 or 1. 8. do not rewrite dir11 when csot11 = 1 (during serial communication).
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 435 (2) serial clock selecti on register 1n (csic1n) this register specifies the timing of the data transmission/reception and sets the serial clock. csic1n can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears this register to 00h. remark n = 0: 78k0/fc2 n = 0, 1: 78k0/fe2, 78k0/ff2 figure 15-5. format of serial clo ck selection register 10 (csic10) address: ff81h after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 csic10 0 0 0 ckp10 dap10 cks102 cks101 cks100 ckp10 dap10 specification of da ta transmission/reception timing type 0 0 d7 d6 d5 d4 d3 d2 d1 d0 sck10 so10 si10 input timing 1 0 1 d7 d6 d5 d4 d3 d2 d1 d0 sck10 so10 si10 input timing 2 1 0 d7 d6 d5 d4 d3 d2 d1 d0 sck10 so10 si10 input timing 3 1 1 d7 d6 d5 d4 d3 d2 d1 d0 sck10 so10 si10 input timing 4 csi10 serial clock selection notes 1, 2 cks102 cks101 cks100 f prs = 4 mhz f prs = 5 mhz f prs = 10 mhz f prs = 20 mhz mode 0 0 0 f prs /2 2 mhz 2.5 mhz 5 mhz 10 mhz 0 0 1 f prs /2 2 1 mhz 1.25 mhz 2.5 mhz 5 mhz 0 1 0 f prs /2 3 500 khz 625 khz 1.25 mhz 2.5 mhz 0 1 1 f prs /2 4 250 khz 312.5 khz 625 khz 1.25 mhz 1 0 0 f prs /2 5 125 khz 156.25 khz 312.5 khz 625 khz 1 0 1 f prs /2 6 62.5 khz 78.13 khz 156.25 khz 312.5 khz 1 1 0 f prs /2 7 31.25 khz 39.06 khz 78.13 khz 156.25 khz master mode 1 1 1 external clock input to sck10 slave mode
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 436 notes 1. the frequency that can be used for the peripheral hardware clock (f prs ) differs depending on the power supply voltage and product specifications. supply voltage peripheral hardware clock frequency 4.0 v v dd 5.5 v f prs 20 mhz 2.7 v v dd < 4.0 v f prs 10 mhz 1.8 v v dd < 2.7 v ((a) grade products only) f prs 5 mhz (the values shown in the table above are those when f prs = f xh (xsel = 1).) 2. set the serial clock to satisfy the following conditions. supply voltage (a) grade products (a2) grade products v dd = 4.0 to 5.5 v serial clock 5 mhz serial clock 5 mhz v dd = 2.7 to 4.0 v serial clock 2.5 mhz serial clock 2.5 mhz v dd = 1.8 to 2.7 v serial clock 1.66 mhz ? cautions 1. do not write to csic10 while csie10 = 1 (operation enabled). 2. to use p10/sck10/t x d61 and p12/so10 as general-purpose ports, set csic10 in the default status (00h). 3. the phase type of the data clock is type 1 after reset. remark f prs : peripheral hardware clock frequency
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 437 figure 15-6. format of serial clo ck selection register 11 (csic11) address: ff89h after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 csic11 0 0 0 ckp11 dap11 cks112 cks111 cks110 ckp11 dap11 specification of da ta transmission/reception timing type 0 0 d7 d6 d5 d4 d3 d2 d1 d0 sck11 so11 si11 input timing 1 0 1 d7 d6 d5 d4 d3 d2 d1 d0 sck11 so11 si11 input timing 2 1 0 d7 d6 d5 d4 d3 d2 d1 d0 sck11 so11 si11 input timing 3 1 1 d7 d6 d5 d4 d3 d2 d1 d0 sck11 so11 si11 input timing 4 csi11 serial clock selection notes 1, 2 cks112 cks111 cks110 f prs = 4 mhz f prs = 5 mhz f prs = 10 mhz f prs = 20 mhz mode 0 0 0 f prs /2 2 mhz 2.5 mhz 5 mhz 10 mhz 0 0 1 f prs /2 2 1 mhz 1.25 mhz 2.5 mhz 5 mhz 0 1 0 f prs /2 3 500 khz 625 khz 1.25 mhz 2.5 mhz 0 1 1 f prs /2 4 250 khz 312.5 khz 625 khz 1.25 mhz 1 0 0 f prs /2 5 125 khz 156.25 khz 312.5 khz 625 khz 1 0 1 f prs /2 6 62.5 khz 78.13 khz 156.25 khz 312.5 khz 1 1 0 f prs /2 7 31.25 khz 39.06 khz 78.13 khz 156.25 khz master mode 1 1 1 external clock input to sck11 slave mode notes 1. the frequency that can be used for the peripheral hardware clock (f prs ) differs depending on the power supply voltage and product specifications. supply voltage peripheral hardware clock frequency 4.0 v v dd 5.5 v f prs 20 mhz 2.7 v v dd < 4.0 v f prs 10 mhz 1.8 v v dd < 2.7 v((a) grade products only) f prs 5 mhz (the values shown in the table above are those when f prs = f xh (xsel = 1).)
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 438 notes 2. set the serial clock to satisfy the following conditions. supply voltage (a) grade products (a2) grade products v dd = 4.0 to 5.5 v serial clock 5 mhz serial clock 5 mhz v dd = 2.7 to 4.0 v serial clock 2.5 mhz serial clock 2.5 mhz v dd = 1.8 to 2.7 v serial clock 1.66 mhz ? cautions 1. do not write to csic11 while csie11 = 1 (operation enabled). 2. to use p74/so11 and p76/sck11 as general- purpose ports, set csic11 in the default status (00h). 3. the phase type of the data clock is type 1 after reset. remark f prs : peripheral hardware clock frequency
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 439 (3) port mode registers 0, 1 and 7 (pm0, pm1, pm7) these registers set port 0, 1 and 7 input/output in 1-bit units. when using p10/sck10 and p76/sck11 as the clock output pins of the seri al interface, clear pm10 and pm76, and the output latches of p10 and p76 to 1. when using p12/so10 and p74/so11 as the data output pins of the serial inte rface, clear pm12, pm74, p12 and p74 to 0. when using p10/sck10/txd61 and p76/sck11 as the clock input pins of the serial interface, p11/si10/rxd61 and p75/si11 as the data input pins, an d p05/ssi11/ti001 as the chip select input pin, set pm10, pm76, pm11, pm75 and pm05 to 1. at this time, the output latches of p10, p76, p11, p75 and p05 may be 0 or 1. pm0, pm1 and pm7 can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation sets these registers to ffh. figure 15-7. format of port mode register 0 (pm0) address: ff20h after reset: ffh r/w symbol 7 6 5 4 3 2 1 0 pm0 1 pm06 pm05 1 1 1 pm01 pm00 pm0n p0n pin i/o mode selection (n = 0, 1, 5, 6) 0 output mode (output buffer on) 1 input mode (output buffer off) remark the figure shown above presents the format of port mode register 0 of 78k0/ff2 products. for the format of port mode register 0 of other products, see (1) port mode registers (pmxx) in 5.3 registers controlling port function . figure 15-8. format of port mode register 1 (pm1) address: ff21h after reset: ffh r/w symbol 7 6 5 4 3 2 1 0 pm1 pm17 pm16 pm15 pm14 pm13 pm12 pm11 pm10 pm1n p1n pin i/o mode selection (n = 0 to 7) 0 output mode (output buffer on) 1 input mode (output buffer off)
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 440 figure 15-9. format of port mode register 7 (pm7) address: ff2ch after reset: ffh r/w symbol 7 6 5 4 3 2 1 0 pm7 1 pm76 pm75 pm74 pm73 pm72 pm71 pm70 pm7n p7n pin i/o mode selection (n = 0 to 6) 0 output mode (output buffer on) 1 input mode (output buffer off) remark the figure shown above presents the format of port mode register 0 of 78k0/ff2 products. for the format of port mode register 0 of other products, see (1) port mode registers (pmxx) in 5.3 registers controlling port function .
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 441 15.4 operation of serial interfaces csi10 and csi11 serial interfaces csi10 and csi11 can be used in the following two modes. ? operation stop mode ? 3-wire serial i/o mode 15.4.1 operation stop mode serial communication is not executed in this mode. therefore, the power consumption can be reduced. in addition, the p10/sck10/t x d61, p11/si10/r x d61, p12/so10, p74/so11, p75/si 11, and p76/sck11 pins can be used as ordinary i/o port pins in this mode. (1) register used the operation stop mode is set by serial operation mode register 1n (csim1n). to set the operation stop mode, clear bit 7 (csie1n) of csim1n to 0. (a) serial operation mode register 1n (csim1n) csim1n can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears csim1n to 00h. remark n = 0: 78k0/fc2 n = 0, 1: 78k0/fe2, 78k0/ff2 ? serial operation mode register 10 (csim10) address: ff80h after reset: 00h r/w symbol <7> 6 5 4 3 2 1 0 csim10 csie10 trmd10 0 dir10 0 0 0 csot10 csie10 operation control in 3-wire serial i/o mode 0 disables operation note 1 and asynchronously resets the internal circuit note 2 . notes 1. to use p10/sck10/t x d61 and p12/so10 as general-purpose ports, set csim10 in the default status (00h). 2. bit 0 (csot10) of csim10 and serial i/o shift register 10 (sio10) are reset. ? serial operation mode register 11 (csim11) address: ff88h after reset: 00h r/w symbol <7> 6 5 4 3 2 1 0 csim11 csie11 trmd11 sse11 dir11 0 0 0 csot11 csie11 operation control in 3-wire serial i/o mode 0 disables operation note 1 and asynchronously resets the internal circuit note 2 . notes 1. to use p74/so11, p76/sck11, and p05/ssi11/ti001 as general -purpose ports, set csim11 in the default status (00h). 2. bit 0 (csot11) of csim11 and serial i/o shift register 11 (sio11) are reset.
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 442 15.4.2 3-wire serial i/o mode the 3-wire serial i/o mode is used for connecting peripheral ics and display controller s with a clocked serial interface. in this mode, communication is executed by using three lin es: the serial clock (sck1n), serial output (so1n), and serial input (si1n) lines. (1) registers used ? serial operation mode register 1n (csim1n) ? serial clock selection register 1n (csic1n) ? port mode register 1 (pm1) or port mode register 7 (pm7) ? port register 1 (p1) or port register 7 (p7) the basic procedure of setting an operation in the 3-wire se rial i/o mode is as follows. <1> set the csic1n register (see figures 15-5 and 15-6 ). <2> set bits 0 and 4 to 6 (csot1n, dir1n, sse11 (ser ial interface csi11 only), and trmd1n) of the csim1n register (see figures 15-3 and 15-4 ). <3> set bit 7 (csie1n) of the csim1n register to 1. transmission/reception is enabled. <4> write data to transmit buffer register 1n (sotb1n). data transmission/reception is started. read data from serial i/o shift register 1n (sio1n). data reception is started. caution take relationship with the other party of communication when setting the port mode register and port register. remark n = 0: 78k0/fc2 n = 0, 1: 78k0/fe2, 78k0/ff2
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 443 the relationship between the register settings and pins is shown below. table 15-2. relationship between register settings and pins (1/2) (a) serial interface csi10 pin function csie10 trmd10 pm11 p11 pm12 p12 pm10 p10 csi10 operation si10/rxd61/ p11 so10/p12 sck10/txd61/ p10 0 note 1 note 1 note 1 note 1 note 1 note 1 stop rxd61/ p11 p12 txd61/ p10 note 2 1 0 1 note 1 note 1 1 slave reception note 3 si10 p12 sck10 (input) note 3 1 1 note 1 note 1 0 0 1 slave transmission note 3 rxd61/ p11 so10 sck10 (input) note 3 1 1 1 0 0 1 slave transmission/ reception note 3 si10 so10 sck10 (input) note 3 1 0 1 note 1 note 1 0 1 master reception si10 p12 sck10 (output) 1 1 note 1 note 1 0 0 0 1 master transmission rxd61/ p11 so10 sck10 (output) 1 1 1 0 0 0 1 master transmission/ reception si10 so10 sck10 (output) notes 1. can be set as port function. 2. to use p10/sck10/txd61 as port pins, clear ckp10 to 0. 3. to use the slave mode, set cks102, cks101, and cks100 to 1, 1, 1. remark : don?t care csie10: bit 7 of serial operation mode register 10 (csim10) trmd10: bit 6 of csim10 ckp10: bit 4 of serial clock selection register 10 (csic10) cks102, cks101, cks100: bits 2 to 0 of csic10 pm1: port mode register p1: port output latch
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 444 table 15-2. relationship between register settings and pins (2/2) (b) serial interface csi11 pin function csie11 trmd11 sse11 pm75 p75 pm74 p74 pm76 p76 pm05 p05 csi11 operation si11/ p75 so11/ p74 sck11/ p76 ssi11/ ti001/p05 0 note 1 note 1 note 1 note 1 note 1 note 1 note 1 note 1 stop p75 p74 p76 note 2 ti001/ p05 0 note 1 note 1 ti001/ p05 1 0 1 1 note 1 note 1 1 1 slave reception note 3 si11 p74 sck11 (input) note 3 ssi11 0 note 1 note 1 ti001/ p05 1 1 1 note 1 note 1 0 0 1 1 slave transmission note 3 p75 so11 sck11 (input) note 3 ssi11 0 note 1 note 1 ti001/ p05 1 1 1 1 0 0 1 1 slave transmission/ reception note 3 si11 so11 sck11 (input) note 3 ssi11 1 0 0 1 note 1 note 1 0 1 note 1 note 1 master reception si11 p74 sck11 (output) ti001/ p05 1 1 0 note 1 note 1 0 0 0 1 note 1 note 1 master transmission p75 so11 sck11 (output) ti001/ p05 1 1 0 1 0 0 0 1 note 1 note 1 master transmission/ reception si11 so11 sck11 (output) ti001/ p05 notes 1. can be set as port function. 2. to use p76/sck11 as port pins, clear ckp11 to 0. 3. to use the slave mode, set cks112, cks111, and cks110 to 1, 1, 1. remark : don?t care csie11: bit 7 of serial operation mode register 11 (csim11) trmd11: bit 6 of csim11 ckp11: bit 4 of serial clock selection register 11 (csic11) cks112, cks111, cks110: bits 2 to 0 of csic11 pm7: port mode register 7 p7: port 7 output latch pm05: port mode register 05 p05: port 05 output latch
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 445 (2) communication operation in the 3-wire serial i/o mode, data is tr ansmitted or received in 8-bit units. each bit of the dat a is transmitted or received in synchronization with the serial clock. data can be transmitted or received if bit 6 (trmd1n) of serial operation mode register 1n (csim1n) is 1. transmission/reception is started when a value is writt en to transmit buffer register 1n (sotb1n). in addition, data can be received when bit 6 (trmd1n) of seri al operation mode register 1n (csim1n) is 0. reception is started when dat a is read from serial i/o shift register 1n (sio1n). however, communication is performed as follows if bit 5 (s se11) of csim11 is 1 when seri al interface csi11 is in the slave mode. <1> low level input to the ssi11 pin transmission/reception is started when sotb11 is writt en, or reception is star ted when sio11 is read. <2> high level input to the ssi11 pin transmission/reception or reception is held, therefore, even if sotb 11 is written or sio11 is read, transmission/reception or rece ption will not be started. <3> data is written to sotb11 or data is read from sio 11 while a high level is input to the ssi11 pin, then a low level is input to the ssi11 pin transmission/reception or reception is started. <4> a high level is input to the ssi11 pi n during transmission/reception or reception transmission/reception or reception is suspended. after communication has been started, bit 0 (csot1n) of csim1n is set to 1. when communication of 8-bit data has been completed, a communication completion interrupt request flag (csiif1n) is set, and csot1n is cleared to 0. then the next communication is enabled. cautions 1. do not access the control register and data register when csot1n = 1 (during serial communication). 2. when using serial interface csi11, wait fo r the duration of at least one clock before the clock operation is started to change the level of the ssi11 pin in the slave mode; otherwise, malfunctioning may occur. remark n = 0: 78k0/fc2 n = 0, 1: 78k0/fe2, 78k0/ff2
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 446 figure 15-10. timing in 3-wire serial i/o mode (1/2) (1) transmission/reception timing (type 1; trmd1n = 1, dir1n = 0, ckp1n = 0, dap1n = 0, sse11 = 1 note ) aah abh 56h adh 5ah b5h 6ah d5h 55h (communication data) 55h is written to sotb1n. sck1n sotb1n sio1n csot1n csiif1n so1n si1n (receive aah) read/write trigger intcsi1n ssi11 note note the sse11 flag and ssi11 pin are available only for serial interface csi11, and are used in the slave mode. remark n = 0: 78k0/fc2 n = 0, 1: 78k0/fe2, 78k0/ff2
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 447 figure 15-10. timing in 3-wire serial i/o mode (2/2) (2) transmission/reception timing (type 2; trmd1n = 1, dir1n = 0, ckp1n = 0, dap1n = 1, sse11 = 1 note ) abh 56h adh 5ah b5h 6ah d5h sck1n sotb1n sio1n csot1n csiif1n so1n si1n (input aah) aah 55h (communication data) 55h is written to sotb1n. read/write trigger intcsi1n ssi11 note note the sse11 flag and ssi11 pin are available only for serial interface csi11, and are used in the slave mode. remark n = 0: 78k0/fc2 n = 0, 1: 78k0/fe2, 78k0/ff2
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 448 figure 15-11. timing of clock/data phase (a) type 1; ckp1n = 0, dap1n = 0, dir1n = 0 d7 d6 d5 d4 d3 d2 d1 d0 sck1n so1n writing to sotb1n or reading from sio1n si1n capture csiif1n csot1n (b) type 2; ckp1n = 0, dap1n = 1, dir1n = 0 d7 d6 d5 d4 d3 d2 d1 d0 sck1n so1n writing to sotb1n or reading from sio1n si1n capture csiif1n csot1n (c) type 3; ckp1n = 1, dap1n = 0, dir1n = 0 d7 d6 d5 d4 d3 d2 d1 d0 sck1n so1n writing to sotb1n or reading from sio1n si1n capture csiif1n csot1n (d) type 4; ckp1n = 1, dap1n = 1, dir1n = 0 d7 d6 d5 d4 d3 d2 d1 d0 sck1n so1n writing to sotb1n or reading from sio1n si1n capture csiif1n csot1n remarks 1. the above figure illustrates a communication o peration where data is tr ansmitted with the msb first. 2. n = 0: 78k0/fc2 n = 0, 1: 78k0/fe2, 78k0/ff2
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 449 (3) timing of output to so1n pin (first bit) when communication is started, the value of transmit buffe r register 1n (sotb1n) is output from the so1n pin. the output operation of the first bit at this time is described below. figure 15-12. output operation of first bit (1/2) (a) type 1: ckp1n = 0, dap1n = 0 sck1n sotb1n sio1n so1n writing to sotb1n or reading from sio1n first bit 2nd bit output latch (b) type 3: ckp1n = 1, dap1n = 0 sck1n sotb1n sio1n output latch so1n w riting to sotb1n or reading from sio1n first bit 2nd bit the first bit is directly latched by the sotb1n register to the output latch at the falling (or rising) edge of sck1n, and output from the so1n pin via an output selector. then, the value of the so tb1n register is transferred to the sio1n register at the next rising (or fa lling) edge of sck1n, and shifted one bit. at the same time, the first bit of the receive data is stored in the s io1n register via the si1n pin. the second and subsequent bits are latched by the sio1n regi ster to the output latch at the next falling (or rising) edge of sck1n, and the data is output from the so1n pin. remark n = 0: 78k0/fc2 n = 0, 1: 78k0/fe2, 78k0/ff2
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 450 figure 15-12. output operation of first bit (2/2) (c) type 2: ckp1n = 0, dap1n = 1 sck1n sotb1n sio1n so1n writing to sotb1n or reading from sio1n first bit 2nd bit 3rd bit output latch (d) type 4: ckp1n = 1, dap1n = 1 first bit 2nd bit 3rd bit sck1n sotb1n sio1n output latch so1n writing to sotb1n or reading from sio1n the first bit is directly latched by the sotb1n register at the falling edge of the write signal of the sotb1n register or the read signal of the sio1n register, and output from the so1n pin via an output selector. then, the value of the sotb1n register is transfe rred to the sio1n register at the next falling (or ri sing) edge of sck1n, and shifted one bit. at the same time, the first bit of the receive data is stored in the sio1n register via the si1n pin. the second and subsequent bits are latched by the sio1n regi ster to the output latch at the next rising (or falling) edge of sck1n, and the data is output from the so1n pin. remark n = 0: 78k0/fc2 n = 0, 1: 78k0/fe2, 78k0/ff2
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 451 (4) output value of so1n pin (last bit) after communication has been completed, the so1n pin holds the output value of the last bit. figure 15-13. output value of so1n pin (last bit) (1/2) (a) type 1: ckp1n = 0, dap1n = 0 sck1n sotb1n sio1n so1n writing to sotb1n or reading from sio1n ( next request is issued.) last bit output latch (b) type 3: ckp1n = 1, dap1n = 0 last bit ( next request is issued.) sck1n sotb1n sio1n output latch so1n writing to sotb1n or reading from sio1n remark n = 0: 78k0/fc2 n = 0, 1: 78k0/fe2, 78k0/ff2
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 452 figure 15-13. output value of so1n pin (last bit) (2/2) (c) type 2: ckp1n = 0, dap1n = 1 sck1n sotb1n sio1n so1n last bit writing to sotb1n or reading from sio1n ( next request is issued.) output latch (d) type 4: ckp1n = 1, dap1n = 1 last bit ( next request is issued.) sck1n sotb1n sio1n output latch so1n writing to sotb1n or reading from sio1n remark n = 0: 78k0/fc2 n = 0, 1: 78k0/fe2, 78k0/ff2
chapter 15 serial interfaces csi10 and csi11 user?s manual u19180ej1v0ud 453 (5) so1n output (see (a) in figures 15-1 and 15-2) the status of the so1n output is as follows depending on the setting of csie1n, tr md1n, dap1n, and dir1n. table 16-3. so1n output status csie1n trmd1n dap1n dir1n so1n output note 1 trmd1n = 0 notes 2, 3 ? ? low level output note 2 dap1n = 0 ? low level output dir1n = 0 value of bit 7 of sotb1n csie1n = 0 note 2 trmd1n = 1 dap1n = 1 dir1n = 1 value of bit 0 of sotb1n trmd1n = 0 note 3 ? ? low level output csie1n = 1 trmd1n = 1 ? ? transmission data note 4 notes 1. the actual output of the so10/p12 or so11/p02 pin is dete rmined according to pm12 and p12 or pm02 and p02, as well as the so1n output. 2. this is a status after reset. 3. to use the p12/so10 or p02/so 11 pin as general-purpose port, set the serial clock selection register 1n (csic1n) in the default status (00h). 4. after transmission has been completed, the so1n pi n holds the output value of the last bit of transmission data. caution if a value is written to csie1n, trmd1n, dap1n, and dir1n, the output value of so1n changes. remark n = 0: 78k0/fc2 n = 0, 1: 78k0/fe2, 78k0/ff2
user?s manual u19180ej1v0ud 454 chapter 16 can controller 16.1 outline description all 78k0/fx2 microcontroller products features an on-chip 1-channel can (cont roller area network) controller that complies with can protocol as standardized in iso 11898. 16.1.1 features - compliant with iso 11898 and tested according to iso/dis 16845 (can conformance test) - standard frame and extended fram e transmission/reception enabled - transfer rate: 1 mbps max. (can clock input 8 mhz) - 16 message buffers/1 channel - receive/transmit history list function - automatic block transmission function - multi-buffer receive block function - mask setting of four patterns is possible for each channel
chapter 16 can controller user?s manual u19180ej1v0ud 455 16.1.2 overview of functions table 16-1 presents an overview of the can controller functions. table 16-1. overview of functions function details protocol can protocol iso 11898 (standard and extended frame transmission/reception) baud rate maximum 1 mbps (can clock input 8 mhz) data storage storing messages in the can ram number of messages - 16 message buffers/1 channel - each message buffer can be set to be either a transmit message buffer or a receive message buffer. message reception - unique id can be set to each message buffer. - mask setting of four patterns is possible for each channel. - a receive completion interrupt is generated eac h time a message is received and stored in a message buffer. - two or more receive message buffers can be us ed as a fifo receive buffer (multi-buffer receive block function). - receive history list function message transmission - unique id can be set to each message buffer. - transmit completion interrupt for each message buffer - message buffer number 0 to 7 specified as the transmit message buffer can be used for automatic block transfer. message transmis sion interval is programmable (automatic block transmission function (herea fter referred to as ?abt?)). - transmission history list function remote frame processing remote frame processing by transmit message buffer time stamp function - the time stamp function can be set for a message reception when a 16-bit timer is used in combination. time stamp capture trigger can be select ed (sof or eof in a can message frame can be detected.). diagnostic function - readable error counters - ?valid protocol operation flag? fo r verification of bus connections - receive-only mode - single-shot mode - can protocol error type decoding - self-test mode forced release from bus-off state - forced release from bus- off (by ignoring timing constr aint) possible by software. - no automatic release from bus-off (software must re-enable). power save mode - can sleep mode (can be woken up by can bus) - can stop mode (cannot be woken up by can bus) caution to use the can controller, set p70 to 1.
chapter 16 can controller user?s manual u19180ej1v0ud 456 16.1.3 configuration the can controller is composed of the following four blocks. (1) npb interface this functional block provides an npb (nec perip heral i/o bus) interface and means of transmitting and receiving signals between the can module and the host cpu. (2) mcm (message control module) this functional block controls access to the can prot ocol layer and to the can ram within the can module. (3) can protocol layer this functional block is involved in the oper ation of the can protocol and its related settings. (4) can ram this is the can memory functional block, which is used to store message ids, message data, etc. figure 16-1. block diagram of can module ctxd crxd cpu can module can ram npb (nec peripheral i/o bus) mcm (message control module) npb interface interrupt request inttrx0 intrec0 interr0 intwup0 can protocol layer can transceiver message buffer 0 message buffer 1 message buffer 2 message buffer 3 message buffer 15 c 0 mask1 c 0 mask2 c 0 mask3 c 0 mask4 ... can_h0 can_l0 can bus
chapter 16 can controller user?s manual u19180ej1v0ud 457 16.2 can protocol can (controller area network) is a high-speed multiplex communication protocol for real-time communication in automotive applications (class c). can is prescribed by iso 11898. for details, refer to the iso 11898 specifications. the can specification is generally divided into two layers : a physical layer and a data link layer. in turn, the data link layer includes logical link and medium access control. the composition of these layers is illustrated below. figure 16-2. composition of layers physical layer prescription of signal level and bit description data link layer note logical link control (llc) medium access control (mac) acceptance filtering overload report recovery management data capsuled/not capsuled frame coding (stuffing/not stuffing) medium access management error detection error report acknowledgement seriated/not seriated higher lower note can controller specification 16.2.1 frame format (1) standard format frame - the standard format frame uses 11-bit identifiers, wh ich means that it can handle up to 2048 messages. (2) extended format frame - the extended format frame uses 29-bit (11 bits + 18 bits) identifiers which increase the number of messages that can be handled to 2048 x 218 messages. - extended format frame is set when ?recessive level? (cmos level equals ?1?) is set for both the srr and ide bits in the arbitration field.
chapter 16 can controller user?s manual u19180ej1v0ud 458 16.2.2 frame types the following four types of frames are used in the can protocol. table 16-2. frame types frame type description data frame frame used to transmit data remote frame frame used to request a data frame error frame frame used to report error detection overload frame frame used to delay the next data frame or remote frame (1) bus value the bus values are divided into dominant and recessive. - dominant level is indicated by logical 0. - recessive level is indicated by logical 1. - when a dominant level and a recessive level are transmitted simultaneously, the bus value becomes dominant level. 16.2.3 data frame and remote frame (1) data frame a data frame is composed of seven fields. figure 16-3. data frame r d interframe space end of frame (eof) ack field crc field data field control field arbitration field start of frame (sof) data frame <1> <2> <3> <4> <5> <6> <7> <8> remark d: dominant = 0 r: recessive = 1
chapter 16 can controller user?s manual u19180ej1v0ud 459 (2) remote frame a remote frame is composed of six fields. figure 16-4. remote frame r d interframe space end of frame (eof) ack field crc field control field arbitration field start of frame (sof) remote frame <1> <2> <3> <5> <6> <7> <8> remarks 1. the data field is not transferred even if the cont rol field?s data length code is not ?0000b?. 2. d: dominant = 0 r: recessive = 1 (3) description of fields <1> start of frame (sof) the start of frame field is located at t he start of a data frame or remote frame. figure 16-5. start of frame (sof) r d 1 bit start of frame (interframe space or bus idle) (arbitration field) remark d: dominant = 0 r: recessive = 1 ? if dominant level is detected in t he bus idle state, a hard-synchroniza tion is performed (the current tq is assigned to be the sync segment). ? if dominant level is sampled at the sample point following such a hard-synchronization, the bit is assigned to be a sof. if recessive level is detect ed, the protocol layer returns to the bus idle state and regards the preceding dominant pulse as a dist urbance only. no error frame is generated in such case.
chapter 16 can controller user?s manual u19180ej1v0ud 460 <2> arbitration field the arbitration field is used to set the priori ty, data frame/remote frame, and frame format. figure 16-6. arbitration field (in standard format mode) r d ide (r1) r0 rtr identifier arbitration field (control field) (11 bits) id28 id18 (1 bit) (1 bit) cautions 1. id28 to id18 are identifiers. 2. an identifier is transmitted msb first. remark d: dominant = 0 r: recessive = 1 figure 16-7. arbitration field (in extended format mode) r d r1 r0 rtr ide srr identifier identifier arbitration field (control field) (11 bits) (18 bits) id28 id18 id17 id0 (1 bit) (1 bit) (1 bit) cautions 1. id28 to id0 are identifiers. 2. an identifier is transmitted msb first. remark d: dominant = 0 r: recessive = 1 table 16-3. rtr frame settings frame type rtr bit data frame 0 (d) remote frame 1 (r) table 16-4. frame format setting (ide bit) and number of identifier (id) bits frame format srr bit ide bit number. of bits standard format mode none 0 (d) 11 bits extended format mode 1 (r) 1 (r) 29 bits
chapter 16 can controller user?s manual u19180ej1v0ud 461 <3> control field the control field sets ?n? as the number of da ta bytes in the data field (n = 0 to 8). figure 16-8. control field r d r1 (ide) r0 rtr dlc2 dlc3 dlc1 dlc0 control field (data field) (arbitration field) remark d: dominant = 0 r: recessive = 1 in a standard format frame, the control fiel d?s ide bit is the same as the r1 bit. table 16-5. data length setting data length code dlc3 dlc2 dlc1 dlc0 data byte count 0 0 0 0 0 bytes 0 0 0 1 1 byte 0 0 1 0 2 bytes 0 0 1 1 3 bytes 0 1 0 0 4 bytes 0 1 0 1 5 bytes 0 1 1 0 6 bytes 0 1 1 1 7 bytes 1 0 0 0 8 bytes other than above 8 bytes regardless of the value of dlc3 to dlc0 caution in the remote frame, there is no data field even if the data length code is not 0000b.
chapter 16 can controller user?s manual u19180ej1v0ud 462 <4> data field the data field contains the am ount of data (byte units) set by the cont rol field. up to 8 units of data can be set. figure 16-9. data field r d data0 (8 bits) msb lsb data7 (8 bits) msb lsb data field (crc field) (control field) remark d: dominant = 0 r: recessive = 1 <5> crc field the crc field is a 16-bit field that is used to check for errors in transmit data. figure 16-10. crc field r d crc sequence crc delimiter (1 bit) (15 bits) crc field (ack field) (data field or control field) remark d: dominant = 0 r: recessive = 1 - the polynomial p(x) used to generate the 15-b it crc sequence is expressed as follows. p(x) = x 15 + x 14 + x 10 + x 8 + x 7 + x 4 + x 3 + 1 - transmitting node: transmits the crc sequence calcul ated from the data (before bit stuffing) in the start of frame, arbitration field, control field, and data field. - receiving node: compares the crc sequence calcul ated using data bits t hat exclude the stuffing bits in the receive data with the crc sequ ence in the crc field. if the two crc sequences do not match, the node issues an error frame.
chapter 16 can controller user?s manual u19180ej1v0ud 463 <6> ack field the ack field is used to acknowledge normal reception. figure 16-11. ack field r d ack slot (1 bit) ack delimiter (1 bit) ack field (end of frame) (crc field) remark d: dominant = 0 r: recessive = 1 - if no crc error is detected, the receiving node sets the ack slot to the dominant level. - the transmitting node outputs two recessive-level bits. <7> end of frame (eof) the end of frame field indicates the end of data frame/remote frame. figure 16-12. end of frame (eof) r d end of frame (7 bits) (interframe space or overload frame) (ack field) remark d: dominant = 0 r: recessive = 1
chapter 16 can controller user?s manual u19180ej1v0ud 464 <8> interframe space the interframe space is inserted after a data frame, remote frame, error frame, or overload frame to separate one frame from the next. - the bus state differs depend ing on the error status. (a) error active node the interframe space consists of a 3-bit intermission field and a bus idle field. figure 16-13. interframe space (error active node) r d interframe space intermission (3 bits) bus idle (0 to bits) (frame) (frame) remarks 1. bus idle: state in which the bus is not used by any node. 2. d: dominant = 0 r: recessive = 1 (b) error passive node the interframe space consists of an intermission field, a suspend transmission field, and a bus idle field. figure 16-14. interframe space (error passive node) r d interframe space intermission (3 bits) suspend transmission (8 bits) bus idle (0 to bits) (frame) (frame) remarks 1. bus idle: state in which the bus is not used by any node. suspend transmission: sequence of 8 recess ive-level bits transmitted from the node in the error passive status. 2. d: dominant = 0 r: recessive = 1 usually, the intermission field is 3 bits. if the transmi tting node detects a dominant level at the third bit of the intermission field, however, it executes transmission.
chapter 16 can controller user?s manual u19180ej1v0ud 465 - operation in error status table 16-6. operation in error status error status operation error active a node in this status can transm it immediately after a 3-bit intermission. error passive a node in this status can tr ansmit 8 bits after the intermission.
chapter 16 can controller user?s manual u19180ej1v0ud 466 16.2.4 error frame an error frame is output by a node that has detected an error. figure 16-15. error frame <1> r d <2> <3> 6 bits 0 to 6 bits 8 bits (<4>) (<5>) interframe space or overload frame error delimiter error flag2 error flag1 error bit error frame remark d: dominant = 0 r: recessive = 1 table 16-7. definition error frame fields no. name bit count definition <1> error flag1 6 error active node: output s 6 dominant-level bi ts consecutively. error passive node: outputs 6 rece ssive-level bits consecutively. if another node outputs a dominant level while one node is outputting a passive error flag, the passive error flag is not cleared until the same level is detected 6 bits in a row. <2> error flag2 0 to 6 nodes receiving error flag 1 detect bit stuff errors and issues this error flag. <3> error delimiter 8 outputs 8 rece ssive-level bits consecutively. if a dominant level is detected at the 8th bit, an overload frame is transmitted from the next bit. <4> error bit ? the bit at which the error was detected. the error flag is output from the bit next to the error bit. in the case of a crc error, this bit is output following the ack delimiter. <5> interframe space/overload frame ? an interframe space or overload frame starts from here.5
chapter 16 can controller user?s manual u19180ej1v0ud 467 16.2.5 overload frame an overload frame is transmitted under the following conditions. - when the receiving node has not completed the reception operation note - if a dominant level is detected at the first two bits during intermission - if a dominant level is detected at the last bit (7th bit) of the end of frame or at the last bit (8th bit) of the error delimiter/overload delimiter note the can is internally fast enough to process all received frames not generating overload frames. figure 16-16. overload frame <1> r d <2> <3> 6 bits 0 to 6 bits 8 bits (<4>) (<5>) interframe space or overload frame overload delimiter overload flag overload flag frame overload frame remark d: dominant = 0 r: recessive = 1 table 16-8. definition of overload frame fields no name bit count definition <1> overload flag 6 outputs 6 domin ant-level bits consecutively. <2> overload flag from other node 0 to 6 the node that received an overload flag in the interframe space outputs an overload flag. <3> overload delimiter 8 outputs 8 re cessive-level bits consecutively. if a dominant level is detected at the 8th bit, an overload frame is transmitted from the next bit. <4> frame ? output following an end of frame, error delimiter, or overload delimiter. <5> interframe space/overload frame ? an interframe space or overload frame starts from here.
chapter 16 can controller user?s manual u19180ej1v0ud 468 16.3 functions 16.3.1 determining bus priority (1) when a node starts transmission: - during bus idle, the node that out put data first transmits the data. (2) when more than one n ode starts transmission: - the node that outputs the dominant level fo r the longest consecutively from the first bit of the arbitration field acquires the bus priority (if a dominant level and a recessive level are simultaneously transmitted, the dominant level is taken as the bus value). - the transmitting node compares its output arbi tration field and the data level on the bus. table 16-9. determining bus priority level match continuous transmission level mismatch stops transmission at t he bit where mismatch is detected and starts reception at the following bit (3) priority of data frame and remote frame - when a data frame and a remote frame are on the bus, t he data frame has priority because its rtr bit, the last bit in the arbitration field, carries a dominant level. caution if the extended-format data frame and the standard-format remote fram e conflict on the bus (if id28 to id18 of both of them are the same), th e standard-format remote frames takes priority. 16.3.2 bit stuffing bit stuffing is used to establish synchronization by appending 1-bit inverted data if the same level continues for 5 bits, in order to prevent a burst error. table 16-10. bit stuffing transmission during the trans mission of a data frame or remote frame, when the same level continues for 5 bits in the data between the start of frame and the ack field, 1 inverted-level bit of data is inserted before the following bit. reception during the reception of a data frame or remote frame, when the same level continues for 5 bits in the data between the start of frame and the ack field, re ception is continued after deleting the next bit. 16.3.3 multi masters as the bus priority (a node acquiring transmit functions) is determined by the identif ier, any node can be the bus master. 16.3.4 multi cast although there is one transmitting node, two or more nodes can receive the same data at the same time because the same identifier can be set to two or more nodes. 16.3.5 can sleep mode/can stop mode function the can sleep mode/can stop mode func tion puts the can controller in waiting mode to achieve low power consumption. the controller is woken up from the can sleep mode by bus operation but it is not woken up from the can stop mode by bus operation (the can stop mode is controlled by cpu access).
chapter 16 can controller user?s manual u19180ej1v0ud 469 16.3.6 error control function (1) error types table 16-11. error types description of error detection state type detection method detection condition transmission/ reception field/frame bit error comparison of output level and level on the bus mismatch of levels transmitting/ receiving node bit that outputting data on the bus at the start of frame to end of frame, error frame and overload frame. stuff error check the receive data at the stuff bit 6 consecutive bits of the same output level receiving node start of frame to crc sequence crc error comparison of the crc sequence generated from the receive data and the received crc sequence mismatch of crc receiving node crc field form error field/fram e check of the fixed format detection of fixed format violation receiving node crc delimiter ack field end of frame error frame overload frame ack error check of the ack slot by the transmitting node detection of recessive level in ack slot transmitting node ack slot (2) output timing of error frame table 16-12. output timing of error frame type output timing bit error, stuff error, form error, ack error error frame output is started at the timing of the bit following the detected error. crc error error frame output is started at the timing of the bit following the ack delimiter. (3) processing in case of error the transmission node re-transmits the data frame or remote frame after the error frame (however, it does not re-transmit the frame in the single-shot mode.).
chapter 16 can controller user?s manual u19180ej1v0ud 470 (4) error state (a) types of error states the following three types of error states are defined by the can specification. - error active - error passive - bus-off these types of error states are cl assified by the values of the tec7 to tec0 bits (transmission error counter bits) and the rec6 to rec0 bits (reception er ror counter bits) of the can error counter register (c0erc) as shown in table 16-13. the present error state is indicated by t he can module information register (c0info). when each error counter value becomes equal to or greater than the error warning level (96), the tecs0 or recs0 bit of the c0info register is set to 1. in this case, the bus state must be tested because it is considered that the bus has a serious fault. an error counter value of 128 or more indicates an error passive state and the tecs1 or recs1 bit of the c0info register is set to 1. - if the value of the transmission error counter is gr eater than or equal to 256 (actually, the transmission error counter does not indicate a value greater t han or equal to 256), the bus-off state is reached and the boff bit of the c0info register is set to 1. - if only one node is active on the bus at startup (i.e., a particular case such as when the bus is connected only to the local stati on), ack is not returned even if dat a is transmitted. consequently, re- transmission of the error frame and data is repeat ed. in the error passive state, however, the transmission error counter is not incremen ted and the bus-off state is not reached.
chapter 16 can controller user?s manual u19180ej1v0ud 471 table 16-13. types of error states type operation value of error counter indication of c0info register operation specific to given error state error active transmission 0-95 tecs1, tecs0 = 00 reception 0-95 recs1, recs0 = 00 transmission 96-127 tecs1, tecs0 = 01 reception 96-127 recs1, recs0 = 01 - outputs an active error flag (6 consecutive dominant-level bits) on detection of the error. error passive transmission 128-255 tecs1, tecs0 = 11 reception 128 or more recs1, recs0 = 11 - outputs a passive error flag (6 consecutive recessive-level bits) on detection of the error. - transmits 8 recessive-level bits, in between transmissions, following an intermission (suspend transmission). bus-off transmission 256 or more (not indicated) note boff = 1, tecs1, tecs0 = 11 - communication is not possible. messages are not stored when receiving frames, however, the following operations of <1>, <2>, and <3> are done. <1> tsout toggles. <2> rec is incremented/decremented. <3> valid bit is set. - if the can module is entered to the initialization mode and then transition request to any operation mode is made, and when 11 consecutive recessive-level bits are detected 128 times, the error counter is reset to 0 and the error active state can be restored. note the value of the transmission error count er (tec) is invalid when the boff bit is set to 1. if an error that increments the value of the transmission error counter by +8 while the counter value is in a range of 248 to 255, the counter is not incremented and the bus-off state is assumed.
chapter 16 can controller user?s manual u19180ej1v0ud 472 (b) error counter the error counter counts up when an error has occu rred, and counts down upon successful transmission and reception. the error counter is upd ated immediately after error detection. table 16-14. error counter state transmission error counter (tec7 to tec0) reception error counter (rec6 to rec0) receiving node detects an error (except bit error in the active error flag or overload flag). no change +1 (when reps bit = 0) receiving node detects dominant level following error flag of error frame. no change +8 (when reps bit = 0) transmitting node transmits an error flag. [as exceptions, the error counter does not change in the following cases.] <1> ack error is detected in error passive state and dominant level is not detected while the passive error flag is being output. <2> a stuff error is detected in an ar bitration field that transmitted a recessive level as a stuff bit, but a dominant level is detected. +8 no change bit error detection while active error flag or overload flag is being output (error-active transmitting node) +8 no change bit error detection while active error flag or overload flag is being output (error-active receiving node) no change +8 (when reps bit = 0) when the node detects 14 consecutive dominant-level bits from the beginning of the active error flag or overload flag, and then subsequently detects 8 consecutive dominant-lev el bits. when the node detects 8 consecutive dominant levels after a passive error flag +8 (during transmission) +8 (during reception, when reps bit = 0) when the transmitting node has comple ted transmission without error (0 if error counter = 0) ?1 no change when the receiving node has completed reception without error no change - ?1 (1 rec6 to rec0 127, when reps bit = 0) - 0 (rec6 to rec0 = 0, when reps bit = 0) - value of 119 to 255 is set (when reps bit = 1) (c) occurrence of bit error in intermission an overload frame is generated. caution if an error occurs, the error flag output (act ive or passive) is cont rolled according to the contents of the transmission error counter and reception error coun ter before the error occurred. the value of the error counter is incremented after the error flag has been output.
chapter 16 can controller user?s manual u19180ej1v0ud 473 (5) recovery from bus-off state when the can module is in the bus-off state, the can module permanently se ts its output signals (ctxd) to recessive level. the can module recovers from the bus-off stat e in the following bus-off recovery sequence. <1> a request to enter the can initialization mode <2> a request to enter a can operation mode (a) recovery operation through normal recovery sequence (b) forced recovery operation that skips recovery sequence (a) recovery operation from bus-off st ate through normal recovery sequence the can module first issues a request to enter the initialization mode (refer to timing <1> in figure 16- 17). this request will be immediately acknowledged, and the opmode bits of t he c0ctrl register are cleared to 000b. processing such as analyzing the fault that has caused the bus-off state, re-defining the can module and message buffer using applicati on software, or stopping t he operation of the can module can be performed by clearing the gom bit to 0. next, the user requests to change the mode from the initialization mode to an operation mode (refer to timing <2> in figure 16-17). this starts an operation to recover the can module from the bus-off state. the conditions under which the module can recover from the bus-off state are defined by the can protocol iso 11898, and it is necessary to detect 11 c onsecutive recessive-level bits 128 times. at this time, the request to change the mode to an operation mode is held pending until the recovery conditions are satisfied. when the recovery conditions are sati sfied (refer to timing <3> in figure 16-17), the can module can enter the operation mode it has reques ted. until the can m odule enters this operation mode, it stays in the initialization mode. comple tion to be requested operation mode can be confirmed by reading the opmode bits of the c0ctrl register. during the bus-off period and bus-off recovery sequence, the boff bit of the c0info register stays set (to 1). in the bus-off recovery sequence, the rec eption error counter (rec[6:0]) counts the number of times 11 consecutive recessive-level bits have been de tected on the bus. theref ore, the recovery state can be checked by reading rec[6:0]. cautions 1. if the bus-off reco very sequence is interrupted by entering initialization mode and re-entering any operation mode, the bus- off recovery sequence will restart from the beginning, and the waiting phase will be again 128 times 11 recessive-level bits, counted from this point. 2. in the bus-off recover y sequence, rec [6:0] coun ts up (+1) each time 11 consecutive recessive-level bi ts have been detected. even during the bus-off period, the can module can enter the can sleep mode or can stop mode. to start the bus-off recovery sequence, it is necessar y to transit to the initialization mode once. however, when the can module is in ei ther can sleep mode or can stop mode, transition request to the initialization m ode is not accepted, thus you have to release the can sleep mode first. in th is case, as soon as the can sleep mode is released, the bus-off recovery sequence star ts and no transition to initialization mode is necessary. if the can module de tects a dominant edge on the can bus while in sleep mode even during bus-off, the sleep mode will be left and the bus-off recovery sequence will start (in the state that the can clock is supplied, it is necessary to clear the psmode by softw are after dominant edge detection).
chapter 16 can controller user?s manual u19180ej1v0ud 474 figure 16-17. recovery operation from bu s-off state through norma l recovery sequence ?error-passive? 00h 00h 00h 00h 80h tec[7:0] ffh boff bit in c0info register opmode[2:0] in c0ctrl register (user writings) opmode[2:0] in c0ctrl register (user readings) tec[7:0] in c0erc register reps, rec[6:0] in c0erc register tec > ffh 00h 00h 00h ffh < tec [7:0] ?bus-off? ?bus-off-recovery-sequence? ?error-active? 00h tec[7:0] < 80h 00h reps, rec[6:0] < 80h <1> <2> <3> undefined 80h reps, rec[6:0] ffh (b) forced recovery operation that skips bus-off recovery sequence the can module can be forcibly released from the bus -off state, regardless of the bus state, by skipping the bus-off recovery sequence. here is the procedure. first, the can module requests to enter the initiali zation mode. for the operation and points to be noted at this time, refer to (a) reco very operation from bus-off state through normal recovery sequence. next, the module requests to enter an operation mode . at the same time, the ccerc bit of the c0ctrl register must be set to 1. as a result, the bus-off recovery sequence defined by the can protocol iso 11898 is skipped, and the module immediately enters the operation mode. in this case, the module is connected to the can bus after it has monitored 11 consecutive recessive-level bits. for details, refer to the processing in figure 16-56. caution this function is not defined by the can protocol iso 11898. when using this function, thoroughly evaluate its effe ct on the network system. (6) initializing can module error counter re gister (c0erc) in initialization mode if it is necessary to initialize the can module erro r counter register (c0erc) and can module information register (c0info) for debugging or evaluating a program , they can be initialized to the default value by setting the ccerc bit of the c0ctrl register in the initialization mode. when initialization has been completed, the ccerc bit is automatically cleared to 0. cautions 1. this function is enabled only in the in itialization mode. even if the ccerc bit is set to 1 in a can operation mode, the c0erc and c0info registers are not initialized. 2. the ccerc bit can be set at the same ti me as the request to enter a can operation mode.
chapter 16 can controller user?s manual u19180ej1v0ud 475 16.3.7 baud rate control function (1) prescaler the can controller has a prescaler that divides the clock (f can ) supplied to can. this prescaler generates a can protocol layer basic clock (f tq ) derived from the can module system clock (f canmod ), and divided by 1 to 256 (refer to 16.6 (12) can bit rate prescaler register (c0brp) ). (2) data bit time (8-25 time quanta) one data bit time is defined as shown in figure 16-18. the can controller sets time segment 1, time segment 2, and resynchronization jump width (sjw) as the parameter of data bit time, as shown in figure 16-18. time segment 1 is equivalent to the total of the propagation (prop) segment and phase s egment 1 that are defined by the can protocol specification. time segment 2 is equivalent to phase segment 2. figure 16-18. segment setting data bit time(dbt) phase segment 1 prop segment sync segment phase segment 2 time segment 1(tseg1) time segment 2 (tseg2) sample point (spt) segment name settable range notes on setting to confirm to can specification time segment 1 (tseg1) 2tq-16tq ? time segment 2 (tseg2) 1tq-8tq ipt of the ca n controller is 0tq. to conform to the can protocol specification, therefore, a length equal to phase segment 1 must be set here. this means that the length of time segment 1 minus 1tq is the settable upper limit of time segment 2. resynchronization jump width(sjw) 1tq-4tq the length of time segment 1 minus 1tq or 4 tq, whichever is smaller. remark ipt : information processing time tq : time quanta
chapter 16 can controller user?s manual u19180ej1v0ud 476 reference: the can standard iso 11898 specification defines the segments constituting the data bit time as shown in figure 16-19. figure 16-19. reference: configuration of data bit time defined by can specification phase segment 1 prop segment sync segment phase segment 2 sample point (spt) sjw data bit time(dbt) segment name segment length description sync segment (synchronization segment) 1 this segment starts at the edge where the level changes from recessive to dominant when hard-synchronization is established. prop segment programmable to 1 to 8 or more this segment absorbs the delay of the output buffer, can bus, and input buffer. the length of this segment is set so that ack is returned before the start of phase segment 1. time of prop segment (delay of output buffer) + 2 x (delay of can bus) + (delay of input buffer) phase segment 1 programmable to 1 to 8 phase segment 2 phase segment 1 or ipt, whichever greater this segment compensates for an error of data bit time. the longer this segment, the wider the permissible range but the slower the communication speed. sjw programmable from 1tq to length of segment 1 or 4tq, whichever is smaller this width sets the upper limit of expansion or contraction of the phase segment during resynchronization. remark ipt : information processing time tq : time quanta
chapter 16 can controller user?s manual u19180ej1v0ud 477 (3) synchronizing data bit - the receiving node establishes synchronization by a level change on the bus because it does not have a sync signal. - the transmitting node transmits data in synchroniz ation with the bit timing of the transmitting node. (a) hard-synchronization this synchronization is established when the receiving node detects the start of frame in the interframe space. - when a falling edge is detected on t he bus, that tq means the sync segment and the next segment is the prop segment. in this case, synchroni zation is established regardless of sjw. figure 16-20. hard-synchroniza tion at recognition of domi nant level during bus idle start of frame interframe space canbus bit timing phase segment 1 prop segment sync segment phase segment 2
chapter 16 can controller user?s manual u19180ej1v0ud 478 (b) resynchronization synchronization is established again if a level change is detected on th e bus during reception (only if a recessive level was sampled previously). - the phase error of the edge is given by the relati ve position of the detected edge and sync segment. 0: if the edge is within the sync segment positive: if the edge is before the sample point (phase error) negative: if the edge is after the sample point (phase error) if phase error is positive: phase segment 1 is longer by specified sjw. if phase error is negative: phase segment 2 is shorter by specified sjw. - the sample point of the data of the receiving node moves relatively due to the ?discrepancy? in baud rate between the transmitting node and receiving node. figure 16-21. resynchronization can bus bit timing can bus bit timing data bit time(dbt) phase segment 1 prop segment sync segment phase segment 2 phase segment 1 prop segment sync segment phase segment 2 sample point sample point if phase error is negative if phase error is positve
chapter 16 can controller user?s manual u19180ej1v0ud 479 16.4 connection with target system the microcontroller incorporated a can has to be connec ted to the can bus using an external transceiver. figure 16-22. connection to can bus microcontroller incorporated a can transceiver ctxd crxd can_l can_h
chapter 16 can controller user?s manual u19180ej1v0ud 480 16.5 internal registers of can controller 16.5.1 can controller configuration table 16-15. list of can controller registers item register name can global registers can global control register (c0gmctrl) can global clock selection register (c0gmcs) can global automatic block transm ission control register (c0gmabt) can global automatic block transm ission delay register (c0gmabtd) can module registers can module mask 1 register (c0mask1l, c0mask1h) can module mask 2 register (c0mask2l, c0mask2h) can module mask3 register (c0mask3l, c0mask3h) can module mask 4 registers (c0mask4l, c0mask4h) can module control register (c0ctrl) can module last error code register (c0lec) can module information register (c0info) can module error counter register (c0erc) can module interrupt enable register (c0ie) can module interrupt status register (c0ints) can module bit rate prescaler register (c0brp) can module bit rate register (c0btr) can module last in-pointer register (c0lipt) can module receive histor y list register (c0rgpt) can module last out-pointer register (c0lopt) can module transmit histor y list register (c0tgpt) can module time stamp register (c0ts) message buffer registers can message data byte 01 register m (c0mdata01m) can message data byte 0 register m (c0mdata0m) can message data byte 1 register m (c0mdata1m) can message data byte 23 register m (c0mdata23m) can message data byte 2 register m (c0mdata2m) can message data byte 3 register m (c0mdata3m) can message data byte 45 register m (c0mdata45m) can message data byte 4 register m (c0mdata4m) can message data byte 5 register m (c0mdata5m) can message data byte 67 register m (c0mdata67m) can message data byte 6 register m (c0mdata6m) can message data byte 7 register m (c0mdata7m) can message data length register m (c0mdlcm) can message configuration register m (c0mconfm) can message id register m (c0midlm, c0midhm) can message control register m (c0mctrlm) remarks 1. can global registers are identified by c0gm. can module registers are identif ied by c0. message buffer registers are identified by c0m. 2. m = 0 to 15
chapter 16 can controller user?s manual u19180ej1v0ud 481 16.5.2 register access type table 16-16. register access types (1/9) bit manipulation units address register name symbol r/w 1 8 16 default value fa00h can0 message data byte 01 register 00 c0mdata0100 undefined fa00h can0 message data byte 0 register 00 c0mdata000 undefined fa01h can0 message data byte 1 register 00 c0mdata100 undefined fa02h can0 message data byte 23 register 00 c0mdata2300 undefined fa02h can0 message data byte 2 register 00 c0mdata200 undefined fa03h can0 message data byte 3 register 00 c0mdata300 undefined fa04h can0 message data byte 45 register 00 c0mdata4500 undefined fa04h can0 message data byte 4 register 00 c0mdata400 undefined fa05h can0 message data byte 5 register 00 c0mdata500 undefined fa06h can0 message data byte 67 register 00 c0mdata6700 undefined fa06h can0 message data byte 6 register 00 c0mdata600 undefined fa07h can0 message data byte 7 register 00 c0mdata700 undefined fa08h can0 message data length code register 00 c0mdlc00 0000xxxxb fa09h can0 message configuration register 00 c0mconf00 undefined fa0ah c0midl00 undefined fa0ch can0 message id register 00 c0midh00 undefined fa0eh can0 message control register 00 c0mctrl00 00x00000 000xx000b fa10h can0 message data byte 01 register 01 c0mdata0101 undefined fa10h can0 message data byte 0 register 01 c0mdata001 undefined fa11h can0 message data byte 1 register 01 c0mdata101 undefined fa12h can0 message data byte 23 register 01 c0mdata2301 undefined fa12h can0 message data byte 2 register 01 c0mdata201 undefined fa13h can0 message data byte 3 register 01 c0mdata301 undefined fa14h can0 message data byte 45 register 01 c0mdata4501 undefined fa14h can0 message data byte 4 register 01 c0mdata401 undefined fa15h can0 message data byte 5 register 01 c0mdata501 undefined fa16h can0 message data byte 67 register 01 c0mdata6701 undefined fa16h can0 message data byte 6 register 01 c0mdata601 undefined fa17h can0 message data byte 7 register 01 c0mdata701 undefined fa18h can0 message data length code register 01 c0mdlc01 0000xxxxb fa19h can0 message configuration register 01 c0mconf01 undefined fa1ah c0midl01 undefined fa1ch can0 message id register 01 c0midh01 undefined fa1eh can0 message control register 01 c0mctrl01 r/w 00x00000 000xx000b
chapter 16 can controller user?s manual u19180ej1v0ud 482 table 16-16. register access types (2/9) bit manipulation units address register name symbol r/w 1 8 16 default value fa20h can0 message data byte 01 register 02 c0mdata0102 undefined fa20h can0 message data byte 0 register 02 c0mdata002 undefined fa21h can0 message data byte 1 register 02 c0mdata102 undefined fa22h can0 message data byte 23 register 02 c0mdata2302 undefined fa22h can0 message data byte 2 register 02 c0mdata202 undefined fa23h can0 message data byte 3 register 02 c0mdata302 undefined fa24h can0 message data byte 45 register 02 c0mdata4502 undefined fa24h can0 message data byte 4 register 02 c0mdata402 undefined fa25h can0 message data byte 5 register 02 c0mdata502 undefined fa26h can0 message data byte 67 register 02 c0mdata6702 undefined fa26h can0 message data byte 6 register 02 c0mdata602 undefined fa27h can0 message data byte 7 register 02 c0mdata702 undefined fa28h can0 message data length code register 02 c0mdlc02 0000xxxxb fa29h can0 message configuration register 02 c0mconf02 undefined fa2ah c0midl02 undefined fa2ch can0 message id register 02 c0midh02 undefined fa2eh can0 message control register 02 c0mctrl02 00x00000 000xx000b fa30h can0 message data byte 01 register 03 c0mdata0103 undefined fa30h can0 message data byte 0 register 03 c0mdata003 undefined fa31h can0 message data byte 1 register 03 c0mdata103 undefined fa32h can0 message data byte 23 register 03 c0mdata2303 undefined fa32h can0 message data byte 2 register 03 c0mdata203 undefined fa33h can0 message data byte 3 register 03 c0mdata303 undefined fa34h can0 message data byte 45 register 03 c0mdata4503 undefined fa34h can0 message data byte 4 register 03 c0mdata403 undefined fa35h can0 message data byte 5 register 03 c0mdata503 undefined fa36h can0 message data byte 67 register 03 c0mdata6703 undefined fa36h can0 message data byte 6 register 03 c0mdata603 undefined fa37h can0 message data byte 7 register 03 c0mdata703 undefined fa38h can0 message data length code register 03 c0mdlc03 0000xxxxb fa39h can0 message configuration register 03 c0mconf03 undefined fa3ah c0midl03 undefined fa3ch can0 message id register 03 c0midh03 undefined fa3eh can0 message control register 03 c0mctrl03 r/w 00x00000 000xx000b
chapter 16 can controller user?s manual u19180ej1v0ud 483 table 16-16. register access types (3/9) bit manipulation units address register name symbol r/w 1 8 16 default value fa40h can0 message data byte 01 register 04 c0mdata0104 undefined fa40h can0 message data byte 0 register 04 c0mdata004 undefined fa41h can0 message data byte 1 register 04 c0mdata104 undefined fa42h can0 message data byte 23 register 04 c0mdata2304 undefined fa42h can0 message data byte 2 register 04 c0mdata204 undefined fa43h can0 message data byte 3 register 04 c0mdata304 undefined fa44h can0 message data byte 45 register 04 c0mdata4504 undefined fa44h can0 message data byte 4 register 04 c0mdata404 undefined fa45h can0 message data byte 5 register 04 c0mdata504 undefined fa46h can0 message data byte 67 register 04 c0mdata6704 undefined fa46h can0 message data byte 6 register 04 c0mdata604 undefined fa47h can0 message data byte 7 register 04 c0mdata704 undefined fa48h can0 message data length code register 04 c0mdlc04 0000xxxxb fa49h can0 message configuration register 04 c0mconf04 undefined fa4ah c0midl04 undefined fa4ch can0 message id register 04 c0midh04 undefined fa4eh can0 message control register 04 c0mctrl04 00x00000 000xx000b fa50h can0 message data byte 01 register 05 c0mdata0105 undefined fa50h can0 message data byte 0 register 05 c0mdata005 undefined fa51h can0 message data byte 1 register 05 c0mdata105 undefined fa52h can0 message data byte 23 register 05 c0mdata2305 undefined fa52h can0 message data byte 2 register 05 c0mdata205 undefined fa53h can0 message data byte 3 register 05 c0mdata305 undefined fa54h can0 message data byte 45 register 05 c0mdata4505 undefined fa54h can0 message data byte 4 register 05 c0mdata405 undefined fa55h can0 message data byte 5 register 05 c0mdata505 undefined fa56h can0 message data byte 67 register 05 c0mdata6705 undefined fa56h can0 message data byte 6 register 05 c0mdata605 undefined fa57h can0 message data byte 7 register 05 c0mdata705 undefined fa58h can0 message data length code register 05 c0mdlc05 0000xxxxb fa59h can0 message configuration register 05 c0mconf05 undefined fa5ah c0midl05 undefined fa5ch can0 message id register 05 c0midh05 undefined fa5eh can0 message configuration register 05 c0mctrl05 r/w 00x00000 000xx000b
chapter 16 can controller user?s manual u19180ej1v0ud 484 table 16-16. register access types (4/9) bit manipulation units address register name symbol r/w 1 8 16 default value fa60h can0 message data byte 01 register 06 c0mdata0106 undefined fa60h can0 message data byte 0 register 06 c0mdata006 undefined fa61h can0 message data byte 1 register 06 c0mdata106 undefined fa62h can0 message data byte 23 register 06 c0mdata2306 undefined fa62h can0 message data byte 2 register 06 c0mdata206 undefined fa63h can0 message data byte 3 register 06 c0mdata306 undefined fa64h can0 message data byte 45 register 06 c0mdata4506 undefined fa64h can0 message data byte 4 register 06 c0mdata406 undefined fa65h can0 message data byte 5 register 06 c0mdata506 undefined fa66h can0 message data byte 67 register 06 c0mdata6706 undefined fa66h can0 message data byte 6 register 06 c0mdata606 undefined fa67h can0 message data byte 7 register 06 c0mdata706 undefined fa68h can0 message data length code register 06 c0mdlc06 0000xxxxb fa69h can0 message configuration register 06 c0mconf06 undefined fa6ah c0midl06 undefined fa6ch can0 message id register 06 c0midh06 undefined fa6eh can0 message control register 06 c0mctrl06 00x00000 000xx000b fa70h can0 message data byte 01 register 07 c0mdata0107 undefined fa70h can0 message data byte 0 register 07 c0mdata007 undefined fa71h can0 message data byte 1 register 07 c0mdata107 undefined fa72h can0 message data byte 23 register 07 c0mdata2307 undefined fa72h can0 message data byte 2 register 07 c0mdata207 undefined fa73h can0 message data byte 3 register 07 c0mdata307 undefined fa74h can0 message data byte 45 register 07 c0mdata4507 undefined fa74h can0 message data byte 4 register 07 c0mdata407 undefined fa75h can0 message data byte 5 register 07 c0mdata507 undefined fa76h can0 message data byte 67 register 07 c0mdata6707 undefined fa76h can0 message data byte 6 register 07 c0mdata607 undefined fa77h can0 message data byte 7 register 07 c0mdata707 undefined fa78h can0 message data length code register 07 c0mdlc07 0000xxxxb fa79h can0 message configuration register 07 c0mconf07 undefined fa7ah c0midl07 undefined fa7ch can0 message id register 07 c0midh07 undefined fa7eh can0 message control register 07 c0mctrl07 r/w 00x00000 000xx000b
chapter 16 can controller user?s manual u19180ej1v0ud 485 table 16-16. register access types (5/9) bit manipulation units address register name symbol r/w 1 8 16 default value fa80h can0 message data byte 01 register 08 c0mdata0108 undefined fa80h can0 message data byte 0 register 08 c0mdata008 undefined fa81h can0 message data byte 1 register 08 c0mdata108 undefined fa82h can0 message data byte 23 register 08 c0mdata2308 undefined fa82h can0 message data byte 2 register 08 c0mdata208 undefined fa83h can0 message data byte 3 register 08 c0mdata308 undefined fa84h can0 message data byte 45 register 08 c0mdata4508 undefined fa84h can0 message data byte 4 register 08 c0mdata408 undefined fa85h can0 message data byte 5 register 08 c0mdata508 undefined fa86h can0 message data byte 67 register 08 c0mdata6708 undefined fa86h can0 message data byte 6 register 08 c0mdata608 undefined fa87h can0 message data byte 7 register 08 c0mdata708 undefined fa88h can0 message data length code register 08 c0mdlc08 0000xxxxb fa89h can0 message configuration register 08 c0mconf08 undefined fa8ah c0midl08 undefined fa8ch can0 message id register 08 c0midh08 undefined fa8eh can0 message control register 08 c0mctrl08 00x00000 000xx000b fa90h can0 message data byte 01 register 09 c0mdata0109 undefined fa90h can0 message data byte 0 register 09 c0mdata009 undefined fa91h can0 message data byte 1 register 09 c0mdata109 undefined fa92h can0 message data byte 23 register 09 c0mdata2309 undefined fa92h can0 message data byte 2 register 09 c0mdata209 undefined fa93h can0 message data byte 3 register 09 c0mdata309 undefined fa94h can0 message data byte 45 register 09 c0mdata4509 undefined fa94h can0 message data byte 4 register 09 c0mdata409 undefined fa95h can0 message data byte 5 register 09 c0mdata509 undefined fa96h can0 message data byte 67 register 09 c0mdata6709 undefined fa96h can0 message data byte 6 register 09 c0mdata609 undefined fa97h can0 message data byte 7 register 09 c0mdata709 undefined fa98h can0 message data length code register 09 c0mdlc09 0000xxxxb fa99h can0 message configuration register 09 c0mconf09 undefined fa9ah c0midl09 undefined fa9ch can0 message id register 09 c0midh09 undefined fa9eh can0 message control register 09 c0mctrl09 r/w 00x00000 000xx000b
chapter 16 can controller user?s manual u19180ej1v0ud 486 table 16-16. register access types (6/9) bit manipulation units address register name symbol r/w 1 8 16 default value faa0h can0 message data byte 01 register 10 c0mdata0110 undefined faa0h can0 message data byte 0 register 10 c0mdata010 undefined faa1h can0 message data byte 1 register 10 c0mdata110 undefined faa2h can0 message data byte 23 register 10 c0mdata2310 undefined faa2h can0 message data byte 2 register 10 c0mdata210 undefined faa3h can0 message data byte 3 register 10 c0mdata310 undefined faa4h can0 message data byte 45 register 10 c0mdata4510 undefined faa4h can0 message data byte 4 register 10 c0mdata410 undefined faa5h can0 message data byte 5 register 10 c0mdata510 undefined faa6h can0 message data byte 67 register 10 c0mdata6710 undefined faa6h can0 message data byte 6 register 10 c0mdata610 undefined faa7h can0 message data byte 7 register 10 c0mdata710 undefined faa8h can0 message data length code register 10 c0mdlc10 0000xxxxb faa9h can0 message configurat ion register 10 c0mconf10 undefined faaah c0midl10 undefined faach can0 message id register 10 c0midh10 undefined faaeh can0 message control register 10 c0mctrl10 00x00000 000xx000b fab0h can0 message data byte 01 register 11 c0mdata0111 undefined fab0h can0 message data byte 0 register 11 c0mdata011 undefined fab1h can0 message data byte 1 register 11 c0mdata111 undefined fab2h can0 message data byte 23 register 11 c0mdata2311 undefined fab2h can0 message data byte 2 register 11 c0mdata211 undefined fab3h can0 message data byte 3 register 11 c0mdata311 undefined fab4h can0 message data byte 45 register 11 c0mdata4511 undefined fab4h can0 message data byte 4 register 11 c0mdata411 undefined fab5h can0 message data byte 51 register 11 c0mdata511 undefined fab6h can0 message data byte 67 register 11 c0mdata6711 undefined fab6h can0 message data byte 6 register 11 c0mdata611 undefined fab7h can0 message data byte 71 register 11 c0mdata711 undefined fab8h can0 message data length code register 11 c0mdlc11 0000xxxxb fab9h can0 message configurat ion register 11 c0mconf11 undefined fabah c0midl11 undefined fabch can0 message id register 11 c0midh11 undefined fabeh can0 message control register 11 c0mctrl11 r/w 00x00000 000xx000b
chapter 16 can controller user?s manual u19180ej1v0ud 487 table 16-16. register access types (7/9) bit manipulation units address register name symbol r/w 1 8 16 default value fac0h can0 message data byte 01 register 12 c0mdata0112 undefined fac0h can0 message data byte 0 register 12 c0mdata012 undefined fac1h can0 message data byte 1 register 12 c0mdata112 undefined fac2h can0 message data byte 23 register 12 c0mdata2312 undefined fac2h can0 message data byte 2 register 12 c0mdata212 undefined fac3h can0 message data byte 3 register 12 c0mdata312 undefined fac4h can0 message data byte 45 register 12 c0mdata4512 undefined fac4h can0 message data byte 4 register 12 c0mdata412 undefined fac5h can0 message data byte 5 register 12 c0mdata512 undefined fac6h can0 message data byte 67 register 12 c0mdata6712 undefined fac6h can0 message data byte 6 register 12 c0mdata612 undefined fac7h can0 message data byte 7 register 12 c0mdata712 undefined fac8h can0 message data length code register 12 c0mdlc12 0000xxxxb fac9h can0 message configuration register 12 c0mconf12 undefined facah c0midl12 undefined facch can0 message id register 12 c0midh12 undefined faceh can0 message control register 12 c0mctrl12 00x00000 000xx000b fad0h can0 message data byte 01 register 13 c0mdata0113 undefined fad0h can0 message data byte 0 register 13 c0mdata013 undefined fad1h can0 message data byte 1 register 13 c0mdata113 undefined fad2h can0 message data byte 23 register 13 c0mdata2313 undefined fad2h can0 message data byte 2 register 13 c0mdata213 undefined fad3h can0 message data byte 3 register 13 c0mdata313 undefined fad4h can0 message data byte 45 register 13 c0mdata4513 undefined fad4h can0 message data byte 4 register 13 c0mdata413 undefined fad5h can0 message data byte 5 register 13 c0mdata513 undefined fad6h can0 message data byte 67 register 13 c0mdata6713 undefined fad6h can0 message data byte 6 register 13 c0mdata613 undefined fad7h can0 message data byte 7 register 13 c0mdata713 undefined fad8h can0 message data length code register 13 c0mdlc13 0000xxxxb fad9h can0 message configuration register 13 c0mconf13 undefined fadah c0midl13 undefined fadch can0 message id register 13 c0midh13 undefined fadeh can0 message control register 13 c0mctrl13 r/w 00x00000 000xx000b
chapter 16 can controller user?s manual u19180ej1v0ud 488 table 16-16. register access types (8/9) bit manipulation units address register name symbol r/w 1 8 16 default value fae0h can0 message data byte 01 register 14 c0mdata0114 undefined fae0h can0 message data byte 0 register 14 c0mdata014 undefined fae1h can0 message data byte 1 register 14 c0mdata114 undefined fae2h can0 message data byte 23 register 14 c0mdata2314 undefined fae2h can0 message data byte 2 register 14 c0mdata214 undefined fae3h can0 message data byte 3 register 14 c0mdata314 undefined fae4h can0 message data byte 45 register 14 c0mdata4514 undefined fae4h can0 message data byte 4 register 14 c0mdata414 undefined fae5h can0 message data byte 5 register 14 c0mdata514 undefined fae6h can0 message data byte 67 register 14 c0mdata6714 undefined fae6h can0 message data byte 6 register 14 c0mdata614 undefined fae7h can0 message data byte 7 register 14 c0mdata714 undefined fae8h can0 message data length code register 14 c0mdlc14 0000xxxxb fae9h can0 message configurat ion register 14 c0mconf14 undefined faeah c0midl14 undefined faech can0 message id register 14 c0midh14 undefined faeeh can0 message control register 14 c0mctrl14 00x00000 000xx000b faf0h can0 message data byte 01 register 15 c0mdata0115 undefined faf0h can0 message data byte 0 register 15 c0mdata015 undefined faf1h can0 message data byte 1 register 15 c0mdata115 undefined faf2h can0 message data byte 23 register 15 c0mdata2315 undefined faf2h can0 message data byte 2 register 15 c0mdata215 undefined faf3h can0 message data byte 3 register 15 c0mdata315 undefined faf4h can0 message data byte 45 register 15 c0mdata4515 undefined faf4h can0 message data byte 4 register 15 c0mdata415 undefined faf5h can0 message data byte 5 register 15 c0mdata515 undefined faf6h can0 message data byte 67 register 15 c0mdata6715 undefined faf6h can0 message data byte 6 register 15 c0mdata615 undefined faf7h can0 message data byte 7 register 15 c0mdata715 undefined faf8h can0 message data length code register 15 c0mdlc15 0000xxxxb faf9h can0 message configuration register 15 c0mconf15 undefined fafah c0midl15 undefined fafch can0 message id register 15 c0midh15 undefined fafeh can0 message control register 15 c0mctrl15 r/w 00x00000 000xx000b
chapter 16 can controller user?s manual u19180ej1v0ud 489 table 16-16. register access types (9/9) bit manipulation units address register name symbol r/w 1 8 16 default value ff60h can0 module receive histor y list register c0rgpt r/w ? ? xx02h ff62h can0 module transmit history list register c0tgpt r/w ? ? xx02h ff64h can0 global control register c0gmctrl r/w ? ? 0000h ff66h can0 global automat ic block transmission control register c0gmabt r/w ? ? 0000h ff68h can0 module last out-pointer register c0lopt r ? ? undefined ff6eh can0 global clock sele ct register c0gmcs r/w ? ? 0fh ff6fh can0 global automat ic block transmission delay setting register c0gmabtd r/w ? ? 00h ff70h c0mask1l ff72h can0 module mask 1 register c0mask1h r/w ? ? undefined ff74h c0mask2l ff76h can0 module mask 2 register c0mask2h r/w ? ? undefined ff78h c0mask3l ff7ah can0 module mask 3 register c0mask3h r/w ? ? undefined ff7ch c0mask4l ff7eh can0 module mask 4 register c0mask4h r/w ? ? undefined ff8ah can0 module time stamp register c0ts r/w ? ? 0000h ff90h can0 module control register c0ctrl r/w ? ? 0000h ff92h can0 module last error information register c0lec r/w ? ? 00h ff93h can0 module information register c0info r ? ? 00h ff94h can0 module error counter register c0erc r ? ? 0000h ff96h can0 module interrupt enable register c0ie r/w ? ? 0000h ff98h can0 module interrupt status register c0ints r/w ? ? 0000h ff9ch can0 module bit rate register c0btr r/w ? ? 370fh ff9eh can0 module bit rate pr escaler register c0brp r/w ? ? ffh ff9fh can0 module last in-pointer register c0lipt r ? ? undefined
chapter 16 can controller user?s manual u19180ej1v0ud 490 16.5.3 register bit configuration table 16-17. bit configurat ion of can global registers address symbol bit 7/15 bit 6/14 bit 5/13 bit 4/12 bit 3/11 bit 2/10 bit 1/9 bit 0/8 ff64h 0 0 0 0 0 0 0 clear gom ff65h c0gmctrl(w) 0 0 0 0 0 0 set efsd set gom ff64h c0gmctrl(r) 0 0 0 0 0 0 efsd gom ff65h mbon 0 0 0 0 0 0 0 ff66h c0gmabt(w) 0 0 0 0 0 0 0 clear abttrg ff67h 0 0 0 0 0 0 set abtclr set abttrg ff66h c0gmabt(r) 0 0 0 0 0 0 abtclr abttrg ff67h 0 0 0 0 0 0 0 0 ff6eh c0gmcs 0 0 0 0 ccp3 ccp2 ccp1 ccp0 ff6fh c0gmabtd 0 0 0 0 abtd3 abtd2 abtd1 abtd0 caution the actual register addr ess is calculated as follows: register address = global register area offset (ch dependent) + offset addr ess as listed in table above remark (r) when read (w) when write
chapter 16 can controller user?s manual u19180ej1v0ud 491 table 16-18. bit configuration of can module registers (1/2) address symbol bit 7/15 bit 6/14 bit 5/13 bit 4/12 bit 3/11 bit 2/10 bit 1/9 bit 0/8 ff60h c0rgpt(w) 0 0 0 0 0 0 0 clear rovf ff61h 0 0 0 0 0 0 0 0 ff60h c0rgpt(r) 0 0 0 0 0 0 rhpm rovf ff61h rgpt [7:0] ff62h c0lopt lopt [7:0] ff64h c0tgpt(w) 0 0 0 0 0 0 0 clear tovf ff65h 0 0 0 0 0 0 0 0 ff64h c0tgpt(r) 0 0 0 0 0 0 thpm tovf ff65h tgpt [7:0] ff70h cm1id [7:0] ff71h c0mask1l cm1id [15:8] ff72h c0mask1h cm1id [23:16] ff73h 0 0 0 cm1id [28:24] ff74h c0mask2l cm2id [7:0] ff75h cm2id [15:8] ff76h c0mask2h cm2id [23:16] ff77h 0 0 0 cm2id [28:24] ff78h c0mask3l cm3id [7:0] ff79h cm3id [15:8] ff7ah c0mask3h cm3id [23:16] ff7bh 0 0 0 cm3id [28:24] ff7ch c0mask4l cm4id [7:0] ff7dh cm4id [15:8] ff7eh c0mask4h cm4id [23:16] ff7fh 0 0 0 cm4id [28:24] ff8ah c0ts(w) 0 0 0 0 0 clear tslock clear tssel clear tsen ff8bh 0 0 0 0 0 set tslock set tssel set tsen ff8ah c0ts(r) 0 0 0 0 0 tslock tssel tsen ff8bh 0 0 0 0 0 0 0 0 caution the actual register addr ess is calculated as follows: register address = global register area offset (ch dependent) + offset addr ess as listed in table above remark (r) when read (w) when write
chapter 16 can controller user?s manual u19180ej1v0ud 492 table 16-18. bit configuration of can module registers (2/2) address symbol bit 7/15 bit 6/14 bit 5/13 bit 4/12 bit 3/11 bit 2/10 bit 1/9 bit 0/8 ff90h c0ctrl(w) clear ccerc clear al clear valid clear psmode1 clear psmode0 clear opmode2 clear opmode1 clear opmode0 ff91h set ccerc set al 0 set psmode1 set psmode0 set opmode2 set opmode1 set opmode0 ff90h c0ctrl(r) ccerc al valid psmode1 psmode0 opmode2 opmode1 opmode0 ff91h 0 0 0 0 0 0 rstat tstat ff92h c0lec(w) 0 0 0 0 0 0 0 0 ff92h c0lec(r) 0 0 0 0 0 lec2 lec1 lec0 ff93h c0info 0 0 0 boff tecs1 tecs0 recs1 recs0 ff94h c0erc tec [7:0] ff95h rec [7:0] ff96h c0ie(w) 0 0 clear cie5 clear cie4 clear cie3 clear cie2 clear cie1 clear cie0 ff97h 0 0 set cie5 set cie4 set cie3 set cie2 set cie1 set cie0 ff96h c0ie(r) 0 0 cie5 cie4 cie3 cie2 cie1 cie0 ff97h 0 0 0 0 0 0 0 0 ff98h c0ints(w) 0 0 clear cints5 clear cints4 clear cints3 clear cints2 clear cints1 clear cints0 ff99h 0 0 0 0 0 0 0 0 ff98h c0ints(r) 0 0 cints5 cints4 cints3 cints2 cints1 cints0 ff99h 0 0 0 0 0 0 0 0 ff9ch c0btr 0 0 0 0 tseg1 [3:0] ff9dh 0 0 sjw [1:0] 0 tseg2 [2:0] ff9eh c0brp tqprs [7:0] ff9fh c0lipt lipt [7:0] caution the actual register addr ess is calculated as follows: register address = global register area offset (ch dependent) + offset addr ess as listed in table above remark (r) when read (w) when write
chapter 16 can controller user?s manual u19180ej1v0ud 493 table 16-19. bit configurati on of message buffer registers address symbol bit 7/15 bit 6/14 bit 5/13 bit 4/12 bit 3/11 bit 2/10 bit 1/9 bit 0/8 fax0h message data (byte 0) fax1h c0mdata01m message data (byte 1) fax0h c0mdata0m message data (byte 0) fax1h c0mdata1m message data (byte 1) fax2h c0mdata23m message data (byte 2) fax3h message data (byte 3) fax2h c0mdata2m message data (byte 2) fax3h c0mdata3m message data (byte 3) fax4h c0mdata45m message data (byte 4) fax5h message data (byte 5) fax4h c0mdata4m message data (byte 4) fax5h c0mdata5m message data (byte 5) fax6h c0mdata67m message data (byte 6) fax7h message data (byte 7) fax6h c0mdata6m message data (byte 6) fax7h c0mdata7m message data (byte 7) fax8h c0mdlcm 0 0 0 0 mdlc3 mdlc2 mdlc1 mdlc0 fax9h c0mconfm ows rtr mt2 mt1 mt0 0 0 ma0 faxah id7 id6 id5 id4 id3 id2 id1 id0 faxbh c0midlm id15 id14 id13 id12 id11 id10 id9 id8 faxch id23 id22 id21 id20 id19 id18 id17 id16 faxdh c0midhm ide 0 0 id28 id27 id26 id25 id24 faxeh 0 0 0 clear mow clear ie clear dn clear trq clear rdy faxfh c0mctrlm (w) 0 0 0 0 set ie 0 set trq set rdy faxeh 0 0 0 mow ie dn trq rdy faxfh c0mctrlm (r) 0 0 muc 0 0 0 0 0 caution the actual register addr ess is calculated as follows: register address = global register area offset (ch dependent) + offset addr ess as listed in table above remarks 1. (r) when read (w) when write 2. m = 0 to 15
chapter 16 can controller user?s manual u19180ej1v0ud 494 16.6 bit set/clear function the can control registers include registers whose bits can be set or cleared via the cpu and via the can interface. an operation error occurs if the following registers are written directly. do not write any values directly via bit manipulation, read/modify/write, or direct writing of target values. ? can global control register (c0gmctrl) ? can global automatic block trans mission control register (c0gmabt) ? can module control register (c0ctrl) ? can module interrupt enable register (c0ie) ? can module interrupt status register (c0ints) ? can module receive history list register (c0rgpt) ? can module transmit history list register (c0tgpt) ? can module time stamp register (c0ts) ? can message control register (c0mctrlm) remark m = 0 to 15 all the 16 bits in the above registers can be read via th e usual method. use the procedure described in figure 16- 23 below to set or clear the lower 8 bits in these registers. setting or clearing of lower 8 bits in the above registers is performed in combination with the higher 8 bits (refer to the 16-bit data after a write operation in figure 16-24 ). figure 16-23 shows how the values of set bits or clear bits relate to set/clear/no change operations in the corresponding register. figure 16-23. example of bi t setting/clearing operations 0000000011010001 0000101111011000 set00001011 0000000000000011 clear 11011000 set set no change no change clear no change clear clear bit status register?s current values write values register?s value after write operations
chapter 16 can controller user?s manual u19180ej1v0ud 495 figure 16-24. 16-bit data during write operation 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 set 7 set 6 set 5 set 4 set 3 set 2 set 1 set 0 clear 7 c lear 6 clear 5 clear 4 clear 3 clear 2 clear 1 clear 0 set n clear n status of bit n after bit set/clear operation 0 0 no change 0 1 0 1 0 1 1 1 no change remark n = 0 to 7
chapter 16 can controller user?s manual u19180ej1v0ud 496 16.7 control registers remark m = 0 to 15 (1) can global control register (c0gmctrl) the c0gmctrl register is used to cont rol the operation of the can module. after reset: 0000h r/w address: ff64h, ff65h (a) read 15 14 13 12 11 10 9 8 c0gmctrl mbon 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 0 0 0 0 efsd gom (b) write 15 14 13 12 11 10 9 8 c0gmctrl 0 0 0 0 0 0 set efsd set gom 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 clear gom (a) read mbon bit enabling access to message buffer register, transmit/receive history list registers 0 write access and read access to the message buffe r register and the transmit/receive history list registers is disabled. 1 write access and read access to the message buffe r register and the transmit/receive history list registers is enabled. cautions 1. while the mbon bit is cleared (to 0), software access to the message buffers (c0mdata0m, c0mdata1m, c0mdata01m, c0mdata2m, c0mdata3m, c0mdata23m, c0mdata4m, c0mdata5m, c0mdata45m, c0mdata6m, c0mdata7m, c0mdata67m, c0mdlcm, c0mconfm, c0midlm, c0midhm, and c0mctrlm), or registers related to transmit history or receive history (c0lopt, c0tgpt, c0lipt, and c0rgpt) is disabled. 2. this bit is read-only. even if 1 is written to mbon while it is 0, the value of mbon does not change, and access to the message buffer registers, or registers related to transmit history or receive history remains disabled. remark mbon bit is cleared (to 0) when the can module enters can sleep mode/can stop mode or gom bit is cleared (to 0). mbon bit is set (to 1) when the can sl eep mode/the can stop mode is released or gom bit is set (to 1).
chapter 16 can controller user?s manual u19180ej1v0ud 497 efsd bit enabling forced shut down 0 forced shut down by gom = 0 disabled. 1 forced shut down by gom = 0 enabled. caution to request forced shutdown, the gom bit must be cleared to 0 in a subsequent, immediately following write access after the efsd bit has been set to 1. if access to another register (including readi ng the c0gmctrl register) is executed without clearing the gom bit immediately after the efsd bit has been set to 1, the efsd bit is forcibly cleared to 0, a nd the forced shutdown request is invalid. gom global operation mode bit 0 can module is disabled from operating. 1 can module is enabled to operate. caution the gom bit can be cleared only in the initialization mode or immediately after efsd bit is set (to 1). (b) write set efsd efsd bit setting 0 no change in esfd bit . 1 efsd bit set to 1. set gom clear gom gom bit setting 0 1 gom bit cleared to 0. 1 0 gom bit set to 1. other than above no change in gom bit. caution set gom bit and esfd bit always separately.
chapter 16 can controller user?s manual u19180ej1v0ud 498 (2) can global clock selection register (c0gmcs) the c0gmcs register is used to se lect the can module system clock. after reset: 0fh r/w address: ff6eh 7 6 5 4 3 2 1 0 c0gmcs 0 0 0 0 ccp3 ccp2 ccp1 ccp0 ccp3 ccp2 ccp1 ccp1 can module system clock (f canmod ) 0 0 0 0 f can /1 0 0 0 1 f can /2 0 0 1 0 f can /3 0 0 1 1 f can /4 0 1 0 0 f can /5 0 1 0 1 f can /6 0 1 1 0 f can /7 0 1 1 1 f can /8 1 0 0 0 f can /9 1 0 0 1 f can /10 1 0 1 0 f can /11 1 0 1 1 f can /12 1 1 0 0 f can /13 1 1 0 1 f can /14 1 1 1 0 f can /15 1 1 1 1 f can /16 (default value) remark f can = clock supplied to can
chapter 16 can controller user?s manual u19180ej1v0ud 499 (3) can global automatic block transmission control register (c0gmabt) the c0gmabt register is used to control the automatic block transmission (abt) operation. after reset: 0000h r/w address: ff66h, ff67h (a) read 15 14 13 12 11 10 9 8 c0gmabt 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 0 0 0 0 abtclr abttrg (b) write 15 14 13 12 11 10 9 8 c0gmabt 0 0 0 0 0 0 set abtclr set abttrg 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 clear abttrg caution before changing the normal operation mode with abt to the initialization mode, be sure to set the c0gmabt register to the default value (0000h) and confirm the c0gmabt register is surely init ialized to the default value(0000h). (a) read abtclr automatic block transmission engine clear status bit 0 clearing the automatic transmission engine is completed. 1 the automatic transmission engine is being cleared. remarks 1. set the abtclr bit to 1 while the abttrg bit is cleared (0). the operation is not guaranteed if the abtclr bit is set to 1 while the abttrg bit is set to 1. 2. when the automatic block transmission engine is cleared by setting the abtclr bit to 1, the abtclr bit is automatically cleared to 0 as soon as the requested clearing processing is complete. abttrg automatic block transmission status bit 0 automatic block transmission is stopped. 1 automatic block transmission is under execution. caution do not set the abttrg bit (abttrg = 1) in the initialization mode. if the abttrg bit is set in the initialization mode, the operation is not guaranteed after the can module has entered the normal operation mode with abt. do not set the abttrg bit (1) while the c0ctrl.tstat bit is set (1). confirm tstat = 0 directly in advance before setting abttrg bit.
chapter 16 can controller user?s manual u19180ej1v0ud 500 (b) write set abtclr automatic block trans mission engine clear request bit 0 the automatic block transmission engine is in idle state or under operation. 1 request to clear the automatic block trans mission engine. after the automatic block transmission engine has been cleared, automatic block transmission is started from message buffer 0 by setting the abttrg bit to 1. set abttrg clear abttrg automatic block transmission start bit 0 1 request to stop automatic block transmission. 1 0 request to start automatic block transmission. other than above no change in abttrg bit. caution while receiving a message from another node or transmitting the messages other than the abt messages (message buffer 8 to 15), there is a possibility not to begin immediately the transmission even if the abttrg bit is set to 1. transmission is not aborted even if the abttrg bit is cleared to 0, until the transmission of the abt message, which is currently being transmitted is completed (successfully or not). after that, the transmission is aborted.
chapter 16 can controller user?s manual u19180ej1v0ud 501 (4) can global automatic block transmission delay setting register (c0gmabtd) the c0gmabtd register is used to set the interval at which the data of the message buffer assigned to abt is to be transmitted in the normal operation mode with abt. after reset: 00h r/w address: ff6fh 7 6 5 4 3 2 1 0 c0gmabtd 0 0 0 0 abtd3 abtd2 abtd1 abtd0 abtd3 abtd2 abtd1 abtd0 data frame inte rval during automatic block transmission (unit: data bit time (dbt)) 0 0 0 0 0 dbt (default value) 0 0 0 1 2 5 dbt 0 0 1 0 2 6 dbt 0 0 1 1 2 7 dbt 0 1 0 0 2 8 dbt 0 1 0 1 2 9 dbt 0 1 1 0 2 10 dbt 0 1 1 1 2 11 dbt 1 0 0 0 2 12 dbt other than above setting prohibited cautions 1. do not change the contents of the c0gmabtd register while the abttrg bit is set to 1. 2. the timing at which the abt message is actually transmitted onto the can bus differs depending on the status of transmission from the other station or how a request to transmit a message other than an abt message (message buffers 8 to 15) is made.
chapter 16 can controller user?s manual u19180ej1v0ud 502 (5) can module mask control register (c0maskal, c0maskah) (a = 1, 2, 3, or 4) the c0maskal and c0maskah registers are used to ex tend the number of receivable messages into the same message buffer by masking part of the id com parison of a message and invalidating the id of the masked part. - can module mask 1 register (c0mask1l, c0mask1h) after reset: undefined r/w address: c0mask1l ff70h, ff71h c0mask1h ff72h, ff73h 15 14 13 12 11 10 9 8 c0mask1l cmid15 cmid14 cmid13 cmid12 cmid11 cmid10 cmid9 cmid8 7 6 5 4 3 2 1 0 cmid7 cmid6 cmid5 cmid4 cmid3 cmid2 cmid1 cmid0 15 14 13 12 11 10 9 8 c0mask1h 0 0 0 cmid28 cmid27 cmid26 cmid25 cmid24 7 6 5 4 3 2 1 0 cmid23 cmid22 cmid21 cmid20 cmid19 cmid18 cmid17 cmid16 - can module mask 2 register (c0mask2l, c0mask2h) after reset: undefined r/w address: c0mask2l ff74h, ff75h c0mask2h ff76h, ff77h 15 14 13 12 11 10 9 8 c0mask2l cmid15 cmid14 cmid13 cmid12 cmid11 cmid10 cmid9 cmid8 7 6 5 4 3 2 1 0 cmid7 cmid6 cmid5 cmid4 cmid3 cmid2 cmid1 cmid0 15 14 13 12 11 10 9 8 c0mask2h 0 0 0 cmid28 cmid27 cmid26 cmid25 cmid24 7 6 5 4 3 2 1 0 cmid23 cmid22 cmid21 cmid20 cmid19 cmid18 cmid17 cmid16
chapter 16 can controller user?s manual u19180ej1v0ud 503 - can module mask 3 register (c0mask3l, c0mask3h) after reset: undefined r/w address: c0mask3l ff78h, ff79h c0mask3h ff7ah, ff7bh 15 14 13 12 11 10 9 8 c0mask3l cmid15 cmid14 cmid13 cmid12 cmid11 cmid10 cmid9 cmid8 7 6 5 4 3 2 1 0 cmid7 cmid6 cmid5 cmid4 cmid3 cmid2 cmid1 cmid0 15 14 13 12 11 10 9 8 c0mask3h 0 0 0 cmid28 cmid27 cmid26 cmid25 cmid24 7 6 5 4 3 2 1 0 cmid23 cmid22 cmid21 cmid20 cmid19 cmid18 cmid17 cmid16 - can module mask 4 register (c0mask4l, c0mask4h) after reset: undefined r/w address: c0mask4l ff7ch, ff7dh c0mask4h ff7eh, ff7fh 15 14 13 12 11 10 9 8 c0mask4l cmid15 cmid14 cmid13 cmid12 cmid11 cmid10 cmid9 cmid8 7 6 5 4 3 2 1 0 cmid7 cmid6 cmid5 cmid4 cmid3 cmid2 cmid1 cmid0 15 14 13 12 11 10 9 8 c0mask4h 0 0 0 cmid28 cmid27 cmid26 cmid25 cmid24 7 6 5 4 3 2 1 0 cmid23 cmid22 cmid21 cmid20 cmid19 cmid18 cmid17 cmid16 cmid28-cmid0 sets mask pattern of id bit. 0 the id bits of the message buffer set by the cmid28 to cmid0 bits are compared with the id bits of the received message frame. 1 the id bits of the message buffer set by the cmid28 to cmid0 bits are not compared with the id bits of the received message frame (they are masked). remark masking is always defined by an id length of 29 bits. if a mask is assigned to a message with a standard id, cmid17 to cmid0 are igno red. therefore, only cmid28 to cmid18 of the received id are masked. the same mask can be used for both the standard and extended ids.
chapter 16 can controller user?s manual u19180ej1v0ud 504 (6) can module control register (c0ctrl) the c0ctrl register is used to control the operation mode of the can module. after reset: 0000h r/w address: ff90h, ff91h (a) read 15 14 13 12 11 10 9 8 c0ctrl 0 0 0 0 0 0 rstat tstat 7 6 5 4 3 2 1 0 ccerc al valid psmode1 psmode0 opmode2 opmode1 opmode0 (b) write 15 14 13 12 11 10 9 8 c0ctrl set ccerc set al 0 set psmode1 set psmode0 set opmode2 set opmode1 set opmode0 7 6 5 4 3 2 1 0 clear ccerc clear al clear valid clear psmode1 clear psmode0 clear opmode2 clear opmode1 clear opmode0 (a) read rstat reception status bit 0 reception is stopped. 1 reception is in progress. remark - the rstat bit is set to 1 under the following conditions (timing). - the sof bit of a receive frame is detected - on occurrence of arbitration loss during a transmit frame - the rstat bit is cleared to 0 under the following conditions (timing) - when a recessive level is detected at the second bit of the interframe space - on transition to the initialization mode at the first bit of the interframe space
chapter 16 can controller user?s manual u19180ej1v0ud 505 tstat transmission status bit 0 transmission is stopped. 1 transmission is in progress. remark - the tstat bit is set to 1 under the following conditions (timing). - the sof bit of a transmit frame is detected - the tstat bit is cleared to 0 under the following conditions (timing). - during transition to bus-off state - on occurrence of arbitration loss in transmit frame - on detection of recessive level at the second bit of the interframe space - on transition to the initialization mode at the first bit of the interframe space ccerc error counter clear bit 0 the c0erc and c0info registers are not cleared in the initialization mode. 1 the c0erc and c0info registers are cleared in the initialization mode. remarks 1. the ccerc bit is used to clear the c0erc and c0info registers for re-initialization or forced recovery from the bus-off state. this bit can be set to 1 only in the initialization mode. 2. when the c0erc and c0info registers have been cleared, the ccerc bit is also cleared to 0 automatically. 3. the ccerc bit can be set to 1 at the same time as a request to change the initialization mode to an operation mode is made. 4. the receive data may be corrupted in case of setting the ccerc bit to (1) immediately after ent ering the init mode from self-test mode. al bit to set operation in case of arbitration loss 0 re-transmission is not executed in case of an arbitration loss in the single-shot mode. 1 re-transmission is executed in case of an arbitration loss in the single-shot mode. remark the al bit is valid only in the single-shot mode. valid valid receive message frame detection bit 0 a valid message frame has not been received since the valid bit was last cleared to 0. 1 a valid message frame has been received since the valid bit was last cleared to 0. remarks 1 . detection of a valid receive message frame is not dependent upon storage in the receive message buffer (data frame) or transmit message buffer (remote frame). 2. clear the valid bit (0) before changing the initialization mode to an operation mode. 3 . if only two can nodes are connected to the can bus with one transmitting a message frame in the normal operation mo de and the other in the receive-only mode, the valid bit is not set to 1 before the transmitting node enters the error passive state, because in receive-only mode no acknowledge is generated. 4. in order to clear the valid bit, set the cl ear valid bit to 1 first and confirm that the valid bit is cleared. if it is not cleared, perform clearing processing again.
chapter 16 can controller user?s manual u19180ej1v0ud 506 psmode1 psmode0 power save mode 0 0 no power save mode is selected. 0 1 can sleep mode 1 0 setting prohibited 1 1 can stop mode cautions 1. transition to and from the can stop mode must be made via can sleep mode. a request for direct transition to and from the can stop mode is ignored. 2. the mbon flag of c0gmctrl must be checked after releasing a power save mode, prior to access the message buffers again. 3. can sleep mode requests are kept pending, until cancelled by software or entered on appropriate bus condition (bus idle). software can check the actual status by reading psmode. opmode2 opmode1 opmo de0 operation mode 0 0 0 no operation mode is selected (can module is in the initialization mode). 0 0 1 normal operation mode 0 1 0 normal operation mode with automatic block transmission function (normal operation mode with abt) 0 1 1 receive-only mode 1 0 0 single-shot mode 1 0 1 self-test mode other than above setting prohibited caution transit to initialization mode or power saving modes may take some time. be sure to verify the success of mode change by reading the values, before proceeding. remark the opmode[2:0] bits are read-only in the can sleep mode or can stop mode. (b)write set ccerc clear ccerc setting of ccerc bit 1 1 ccerc bit is set to 1. other than above 0 ccerc bit is not changed. set al clear al setting of al bit 0 1 al bit is cleared to 0. 1 0 al bit is set to 1. other than above al bit is not changed.
chapter 16 can controller user?s manual u19180ej1v0ud 507 clear valid setting of valid bit 0 valid bit is not changed. 1 valid bit is cleared to 0. set psmode0 clear psmode0 setting of psmode0 bit 0 1 psmode0 bit is cleared to 0. 1 0 psmode bit is set to 1. other than above psmode0 bit is not changed. set psmode1 clear psmode1 setting of psmode1 bit 0 1 psmode1 bit is cleared to 0. 1 0 psmode1 bit is set to 1. other than above psmode1 bit is not changed. set opmode0 clear opmode0 setting of opmode0 bit 0 1 opmode0 bit is cleared to 0. 1 0 opmode0 bit is set to 1. other than above opmode0 bit is not changed. set opmode1 clear opmode1 setting of opmode1 bit 0 1 opmode1 bit is cleared to 0. 1 0 opmode1 bit is set to 1. other than above opmode1 bit is not changed. set opmode2 clear opmode2 setting of opmode2 bit 0 1 opmode2 bit is cleared to 0. 1 0 opmode2 bit is set to 1. other than above opmode2 bit is not changed.
chapter 16 can controller user?s manual u19180ej1v0ud 508 (7) can module last error code register (c0lec) the c0lec register provides the erro r information of the can protocol. after reset: 00h r/w address: ff92h 7 6 5 4 3 2 1 0 c0lec 0 0 0 0 0 lec2 lec1 lec0 remarks 1. the contents of the c0lec register are not cleared when the can module changes from an operation mode to the initialization mode. 2. if an attempt is made to write a value ot her than 00h to the c0lec register by software, the access is ignored. lec2 lec1 lec0 last can protocol error information 0 0 0 no error 0 0 1 stuff error 0 1 0 form error 0 1 1 ack error 1 0 0 bit error (the can module tried to tr ansmit a recessive-level bit as part of a transmit message (except the arbitr ation field), but the value on the can bus is a dominant-level bit.) 1 0 1 bit error (the can module tried to transmit a dominant-lev el bit as part of a transmit message, ack bit, error frame, or overload frame, but the value on the can bus is a recessive-level bit.) 1 1 0 crc error 1 1 1 undefined
chapter 16 can controller user?s manual u19180ej1v0ud 509 (8) can module information register (c0info) the c0info register indicates the status of the can module. after reset: 00h r address: ff93h 7 6 5 4 3 2 1 0 c0info 0 0 0 boff tecs1 tecs0 recs1 recs0 boff bus-off state bit 0 not bus-off state (transmit error counter 255) (the value of the transmit counter is less than 256.) 1 bus-off state (transmit error counter > 255) (the value of the transmit counter is 256 or more.) tecs1 tecs0 transmission error counter status bit 0 0 the value of the transmission error counter is less than that of the warning level (<96). 0 1 the value of the transmission error counter is in the range of the warning level (96 to 127). 1 0 undefined 1 1 the value of the transmission error counter is in the range of the error passive or bus-off state ( 128). recs1 recs0 reception e rror counter status bit 0 0 the value of the reception error counter is less than that of the warning level (<96). 0 1 the value of the reception error counter is in the range of the warning level (96 to 127). 1 0 undefined 1 1 the value of the reception error counter is in the error passive range ( 128).
chapter 16 can controller user?s manual u19180ej1v0ud 510 (9) can module error counter register (c0erc) the c0erc register indicates the count value of the transmission/reception error counter. after reset: 0000h r address: ff94h, ff95h 15 14 13 12 11 10 9 8 c0erc reps rec6 rec5 rec4 rec3 rec2 rec1 rec0 7 6 5 4 3 2 1 0 tec7 tec6 tec5 tec4 tec3 tec2 tec1 tec0 reps reception error passive status bit 0 reception error counter is not error passive (<128) 1 reception error counter is error passive range ( 128) rec6-rec0 reception error counter bit 0-127 number of reception errors. these bits re flect the status of the reception error counter. the number of errors is defined by the can protocol. remark rec6 to rec0 of the reception error count er are invalid in the reception error passive state (recs [1:0] = 11b). tec7-tec0 transmission error counter bit 0-255 number of transmission errors. these bits reflect the status of the transmission error counter. the number of errors is defined by the can protocol. remark tec7 to tec0 of the transmission error c ounter are invalid in the bus-off state (boff = 1).
chapter 16 can controller user?s manual u19180ej1v0ud 511 (10) can module interrupt enable register (c0ie) the c0ie register is used to enable or disable the interrupts of the can module. after reset: 0000h r/w address: ff96h, ff97h (a) read 15 14 13 12 11 10 9 8 c0ie 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 cie5 cie4 cie3 cie2 cie1 cie0 (b) write 15 14 13 12 11 10 9 8 c0ie 0 0 set cie5 set cie4 set cie3 set cie2 set cie1 set cie0 7 6 5 4 3 2 1 0 0 0 clear cie5 clear cie4 clear cie3 clear cie2 clear cie1 clear cie0 (a) read cie5-cie0 can module interrupt enable bit 0 output of the interrupt corresponding to interrupt status register cints5 to cints0 bits is disabled. 1 output of the interrupt corresponding to interrupt status register cints5 to cints0 bits is enabled. (b) write set cie5 clear cie5 setting of cie5 bit 0 1 cie5 bit is cleared to 0. 1 0 cie5 bit is set to 1. other than above cie5 bit is not changed. set cie4 clear cie4 setting of cie4 bit 0 1 cie4 bit is cleared to 0. 1 0 cie4 bit is set to 1. other than above cie4 bit is not changed.
chapter 16 can controller user?s manual u19180ej1v0ud 512 set cie3 clear cie3 setting of cie bit 0 1 cie3 bit is cleared to 0. 1 0 cie3 bit is set to 1. other than above cie3 bit is not changed. set cie2 clear cie2 setting of cie2 bit 0 1 cie2 bit is cleared to 0. 1 0 cie2 bit is set to 1. other than above cie2 bit is not changed. set cie1 clear cie1 setting of cie1 bit 0 1 cie1 bit is cleared to 0. 1 0 cie1 bit is set to 1. other than above cie1 bit is not changed. set cie0 clear cie0 setting of cie0 bit 0 1 cie0 bit is cleared to 0. 1 0 cie0 bit is set to 1. other than above cie0 bit is not changed.
chapter 16 can controller user?s manual u19180ej1v0ud 513 (11) can module interrupt status register (c0ints) the c0ints register indicates the in terrupt status of the can module. after reset: 0000h r/w address: ff98h, ff99h (a) read 15 14 13 12 11 10 9 8 c0ints 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 cints5 cints4 cints3 cints2 cints1 cints0 (b) write 15 14 13 12 11 10 9 8 c0ints 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 clear cints5 clear cints4 clear cints3 clear cints2 clear cints1 clear cints0 (a) read cints5-cints0 can interrupt status bit 0 no related interrupt source event is pending. 1 a related interrupt source event is pending. interrupt status bit related interrupt source event cints5 wakeup interrupt from can sleep mode note cints4 arbitration loss interrupt cints3 can protocol error interrupt cints2 can error status interrupt cints1 interrupt on completion of reception of valid message frame to message buffer m cints0 interrupt on normal completion of tr ansmission of message frame from message buffer m note the cints5 bit is set only when the ca n module is woken up from the can sleep mode by a can bus operation. the cints5 bit is not set when the can sleep mode has been released by software. (b) write clear cints5-cints0 setting of cints5 to cints0 bits 0 cints5 to cints0 bits are not changed. 1 cints5 to cints0 bits are cleared to 0. caution please clear the status bit of this register with software when the confirmation of each status is necessary in the interrupt processing, because these bits are not cleared automatically.
chapter 16 can controller user?s manual u19180ej1v0ud 514 (12) can module bit rate prescaler register (c0brp) the c0brp register is used to select the can protocol layer basic clock (f tq ). the communication baud rate is set to the c0btr register. after reset: ffh r/w address: ff9eh 7 6 5 4 3 2 1 0 c0brp tqprs7 tqprs6 tqprs5 tqprs4 tqprs3 tqprs2 tqprs1 tqprs0 tqprs7-tqprs0 can protocol layer basic system clock (f tq ) 0 f canmod /1 1 f canmod /2 : : n f canmod /(n+1) : : 255 f canmod /256 (default value) figure 16-25. can module clock ccp 3 ccp2 prescaler can module bit-rate prescaler register (c0brp) can module clock selection register (c0gmcs) baud rate generator can bit-rate register (c0btr) ccp1 ccp0 tqprs0 f can f canmod f tq 0 0 0 0 tqprs1 tqprs2 tqprs3 tqprs4 tqprs5 tqprs6 tqprs7 caution the c0brp register can be write-accessed only in the initialization mode. remark f can : clock supplied to can (f prs ) f canmod : can module system clock f tq : can protocol layer basic system clock
chapter 16 can controller user?s manual u19180ej1v0ud 515 (13) can module bit rate register (c0btr) the c0btr register is used to control the data bit time of the communication baud rate. after reset: 370fh r/w address: ff9ch, ff9dh 15 14 13 12 11 10 9 8 c0btr 0 0 sjw1 sjw0 0 tseg22 tseg21 tseg20 7 6 5 4 3 2 1 0 0 0 0 0 tseg13 t seg12 tseg11 tseg10 figure 16-26. data bit time data bit time (dbt) time segmet 1(tseg1) phase segment 2 phase segment 1 sample point(spt) prop segment sync segment time segmet 2(tseg2)
chapter 16 can controller user?s manual u19180ej1v0ud 516 sjw1 sjw0 length of synchronization jump width 0 0 1tq 0 1 2tq 1 0 3tq 1 1 4tq (default value) tseg22 tseg21 tseg20 length of time segment 2 0 0 0 1tq 0 0 1 2tq 0 1 0 3tq 0 1 1 4tq 1 0 0 5tq 1 0 1 6tq 1 1 0 7tq 1 1 1 8tq (default value) tseg13 tseg12 tseg 11 tseg10 length of time segment 1 0 0 0 0 setting prohibited 0 0 0 1 2tq note 0 0 1 0 3tq note 0 0 1 1 4tq 0 1 0 0 5tq 0 1 0 1 6tq 0 1 1 0 7tq 0 1 1 1 8tq 1 0 0 0 9tq 1 0 0 1 10tq 1 0 1 0 11tq 1 0 1 1 12tq 1 1 0 0 13tq 1 1 0 1 14tq 1 1 1 0 15tq 1 1 1 1 16tq (default value) note this setting must not be made when the c0brp register = 00h. remark tq = 1/f tq (f tq : can protocol layer basic system clock)
chapter 16 can controller user?s manual u19180ej1v0ud 517 (14) can module last in-pointer register (c0lipt) the c0lipt register indicates the number of the me ssage buffer in which a data frame or a remote frame was last stored. after reset: undefined r address: ff9fh 7 6 5 4 3 2 1 0 c0lipt lipt7 lipt6 lipt5 lipt4 lipt3 lipt2 lipt1 lipt0 lipt7-lipt0 last in-pointer register (c0lipt) 0 to 15 when the c0lipt register is read, the contents of the element indexed by the last in- pointer (lipt) of the receive history list are read. these contents indicate the number of the message buffer in which a data frame or a remote frame was last stored. remark the read value of the c0lipt register is undefined if a data frame or a remote frame has never been stored in the message buffer. if the rhpm bit of the c0rgpt register is set to 1 after the can module has c hanged from the initialization mode to an operation mode, therefore, the read value of the c0lipt register is undefined.
chapter 16 can controller user?s manual u19180ej1v0ud 518 (15) can module receive history list register (c0rgpt) the c0rgpt register is used to read the receive history list. after reset: xx02h r/w address: ff60h, ff61h (a) read 15 14 13 12 11 10 9 8 c0rgpt rgpt7 rgpt6 rgpt5 rgpt 4 rgpt3 rgpt2 rgpt1 rgpt0 7 6 5 4 3 2 1 0 0 0 0 0 0 0 rhpm rovf (b) write 15 14 13 12 11 10 9 8 c0rgpt 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 clear rovf (a) read rgpt7-rgpt0 receive history list get pointer 0 to 15 when the c0rgpt register is read, the contents of the element indexed by the receive history list get pointer (rgpt) of the rece ive history list are read. these contents indicate the number of the message buffer in which a data frame or a remote frame has been stored. rhpm note receive history list pointer match 0 the receive history list has at least one message buffer number that has not been read. 1 the receive history list has no message buffer numbers that has not been read. note the read value of rgpt0 to rgpt7 is invalid when rhpm = 1. rovf receive history list overflow bit 0 all the message buffer numbers that have not been read are preserved. all the numbers of the message buffer in which a new data frame or remote frame has been received and stored are recorded to the receive history list (the re ceive history list has a vacant element). 1 at least 23 entries have been stored since the host processor has serviced the rhl last time (i.e. read c0rgpt). the first 22 entries are sequentially stored while the last entry can have been overwritten whenever newly received message is stored because all buffer numbers are stored at position lipt-1 when rovf bit is set. thus the sequence of receptions can not be recovered completely now. note if rovf is set, rhpm is no longer cleared on message storage, but rhpm is still set, if all entries of c0rgpt are read by software.
chapter 16 can controller user?s manual u19180ej1v0ud 519 (b) write clear rovf setting of rovf bit 0 rovf bit is not changed. 1 rovf bit is cleared to 0. (16) can module last out-pointer register (c0lopt) the c0lopt register indicates the number of the message buffer to whic h a data frame or a remote frame was transmitted last. after reset: undefined r address: ff68h 7 6 5 4 3 2 1 0 c0lopt lopt7 lopt6 lopt5 lopt 4 lopt3 lopt2 lopt1 lopt0 lopt7-lopt0 last out-pointer of transmit history list (lopt) 0 to 15 when the c0lopt register is read, the contents of the element indexed by the last out- pointer (lopt) of the receive history list ar e read. these contents indicate the number of the message buffer to which a data frame or a remote frame was transmitted last. remark the value read from the c0lopt register is undefined if a data frame or remote frame has never been transmitted from a message buffer. if the thpm bit is set to 1 after the can module has changed from the initializa tion mode to an operation mode, therefore, the read value of the c0lopt register is undefined.
chapter 16 can controller user?s manual u19180ej1v0ud 520 (17) can module transmit hist ory list register (c0tgpt) the c0tgpt register is used to read the transmit history list. after reset: xx02h r/w address: ff62h, ff63h (a) read 15 14 13 12 11 10 9 8 c0tgpt tgpt7 tgpt6 tgpt5 tgpt4 tgpt3 tgpt2 tgpt1 tgpt0 7 6 5 4 3 2 1 0 0 0 0 0 0 0 thpm tovf (b) write 15 14 13 12 11 10 9 8 c0tgpt 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 clear tovf (a) read tgpt7-tgpt0 transmit history list read pointer 0 to 15 when the c0tgpt register is read, t he contents of the element indexed by the read pointer (tgpt) of the transmit history list ar e read. these contents indicate the number of the message buffer to which a data frame or a remote frame was transmitted last. thpm note transmit history pointer match 0 the transmit history list has at least one message buffer number that has not been read. 1 the transmit history list has no message buffer number that has not been read. note the read value of tgpt0 to tgpt7 is invalid when thpm = 1. tovf transmit history list overflow bit 0 all the message buffer numbers that have not been read are preserved. all the numbers of the message buffers to which a new data frame or remote frame has been transmitted are recorded to the transmit history list (the transmit history list has a vacant element). 1 at least 7 entries have been stored since the host processor has serviced the thl last time (i.e. read c0tgpt). the first 6 entries are sequentially stored while the last entry can have been overwritten whenever a message is newly transmitted because all buffer numbers are stored at position lopt-1 when tovf bit is set. thus the sequence of transmissions can not be recovered completely now. note if tovf is set, thpm is no longer cleared on message transmission, but thpm is still set, if all entries of c0tgpt are read by software. remark transmission from message buffer 0 to 7 is not recorded to the trans mit history list in the normal operation mode with abt.
chapter 16 can controller user?s manual u19180ej1v0ud 521 (b) write clear tovf setting of tovf bit 0 tovf bit is not changed. 1 tovf bit is cleared to 0. (18) can module time stamp register (c0ts) the c0ts register is used to c ontrol the time stamp function. after reset: 0000h r/w address: ff8ah, ff8bh (a) read 15 14 13 12 11 10 9 8 c0ts 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 0 0 0 tslock tssel tsen (b) write 15 14 13 12 11 10 9 8 c0ts 0 0 0 0 0 set tslock set tssel set tsen 7 6 5 4 3 2 1 0 0 0 0 0 0 clear tslock clear tssel clear tsen remark the lock function of the time stamp f unction must not be used when the can module is in the normal operation mode with abt. (a) read tslock time stamp lock function enable bit 0 time stamp lock function stopped. the tsout signal is toggled each time the se lected time stamp capture event occurs. 1 time stamp lock function enabled. the tsout signal is toggled each time the se lected time stamp capture event occurs. however, the tsout output signal is locked when a data frame has been correctly received to message buffer 0 note . note the tsen bit is automatically cleared to 0. tssel time stamp capture event selection bit 0 the time stamp capture event is sof. 1 the time stamp capture event is the last bit of eof.
chapter 16 can controller user?s manual u19180ej1v0ud 522 tsen tsout signal operation setting bit 0 disable tsout signal toggle operation. 1 enable tsout signal toggle operation. remark the signal tsout is output from the can macro to a timer resource, depending on implementation. refer to figure 14-19. (b) write set tslock clear tslock setting of tslock bit 0 1 tslock bit is cleared to 0. 1 0 tslock bit is set to 1. other than above tslock bit is not changed. set tssel clear tssel setting of tssel bit 0 1 tssel bit is cleared to 0. 1 0 tssel bit is set to 1. other than above tssel bit is not changed. set tsen clear tsen setting of tsen bit 0 1 tsen bit is cleared to 0. 1 0 tsen bit is set to 1. other than above tsen bit is not changed .
chapter 16 can controller user?s manual u19180ej1v0ud 523 (19) can message data byte register (c0mdataxm)(x = 0 to 7), (c0mdatazm) (z = 01, 23, 45, 67) the c0mdataxm, c0mdatazm registers are used to st ore the data of a transmit/r eceive message. the c0mdataxm registers can access in 8-bit units. the c0mdatazm registers can access the c0mdataxm registers in 16-bit units. after reset: undefined r/w address: see table 16-16 - c0mdataxm register 7 6 5 4 3 2 1 0 c0mdata0m mdata07 mdata06 mdata05 md ata04 mdata03 mdata02 mdata01 mdata00 7 6 5 4 3 2 1 0 c0mdata1m mdata17 mdata16 mdata15 mdata14 mdata13 mdata12 mdata11 mdata10 7 6 5 4 3 2 1 0 c0mdata2m mdata27 mdata26 mdata25 md ata24 mdata23 mdata22 mdata21 mdata20 7 6 5 4 3 2 1 0 c0mdata3m mdata37 mdata36 mdata35 mdata34 mdata33 mdata32 mdata31 mdata30 7 6 5 4 3 2 1 0 c0mdata4m mdata47 mdata46 mdata45 md ata44 mdata43 mdata42 mdata41 mdata40 7 6 5 4 3 2 1 0 c0mdata5m mdata57 mdata56 mdata55 md ata54 mdata53 mdata52 mdata51 mdata50 7 6 5 4 3 2 1 0 c0mdata6m mdata67 mdata66 mdata65 md ata64 mdata63 mdata62 mdata61 mdata60 7 6 5 4 3 2 1 0 c0mdata7m mdata77 mdata76 mdata75 md ata74 mdata73 mdata72 mdata71 mdata70
chapter 16 can controller user?s manual u19180ej1v0ud 524 - c0mdatazm register 15 14 13 12 11 10 9 8 c0mdata01m mdata011 5 mdata011 4 mdata011 3 mdata011 2 mdata011 1 mdata011 0 mdata019 mdata018 7 6 5 4 3 2 1 0 mdata017 mdata016 mdata015 mdata0 14 mdata013 mdata012 mdata011 mdata010 15 14 13 12 11 10 9 8 c0mdata23m mdata231 5 mdata231 4 mdata231 3 mdata231 2 mdata231 1 mdata231 0 mdata239 mdata238 7 6 5 4 3 2 1 0 mdata237 mdata236 mdata235 mdata2 34 mdata233 mdata232 mdata231 mdata230 15 14 13 12 11 10 9 8 c0mdata45m mdata451 5 mdata451 4 mdata451 3 mdata451 2 mdata451 1 mdata451 0 mdata459 mdata458 7 6 5 4 3 2 1 0 mdata457 mdata456 mdata455 mdata4 54 mdata453 mdata452 mdata451 mdata450 15 14 13 12 11 10 9 8 c0mdata67m mdata671 5 mdata671 4 mdata671 3 mdata671 2 mdata671 1 mdata671 0 mdata679 mdata678 7 6 5 4 3 2 1 0 mdata677 mdata676 mdata675 mdata6 74 mdata673 mdata672 mdata671 mdata670
chapter 16 can controller user?s manual u19180ej1v0ud 525 (20) can message data length register m (c0mdlcm) the c0mdlcm register is used to set the number of bytes of the data field of a message buffer. after reset: 0000xxxxb r/w address: see table 16-16 7 6 5 4 3 2 1 0 c0mdlcm 0 0 0 0 mdlc3 mdlc2 mdlc1 mdlc0 mdlc3 mdlc2 mdlc1 mdlc0 data length of transmit/receive message 0 0 0 0 0 bytes 0 0 0 1 1 byte 0 0 1 0 2 bytes 0 0 1 1 3 bytes 0 1 0 0 4 bytes 0 1 0 1 5 bytes 0 1 1 0 6 bytes 0 1 1 1 7 bytes 1 0 0 0 8 bytes 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 setting prohibited (if these bits are set during transmi ssion, 8-byte data is transmitted regardless of the set dlc value when a data frame is transmitted. however, the dlc actually transmitted to the can bus is the dlc value set to this register.) note note the data and dlc value actually transmitted to can bus are as follows. type of transmit frame length of transmit data dlc transmitted data frame number of bytes specified by dlc (however, 8 bytes if dlc 8) mdlc[3:0] remote frame 0 bytes cautions 1. be sure to set bits 7 to 4 0000b. 2. receive data is stored in as many c0mdataxm as the number of bytes (however, the upper limit is 8) corres ponding to dlc of the received frame. c0mdataxm in which no data is stored is undefined.
chapter 16 can controller user?s manual u19180ej1v0ud 526 (21) can message configuration register (c0mconfm) the c0mconfm register is used to specify t he type of the message buffer and to set a mask. after reset: undefined r/w address: see table 16-16 7 6 5 4 3 2 1 0 c0mconfm ows rtr mt2 mt1 mt0 0 0 ma0 ows overwrite control bit 0 the message buffer that has already received a data frame note is not overwritten by a newly received data frame. the newly received data frame is discarded. 1 the message buffer that has already received a data frame note is overwritten by a newly received data frame. note the ?message buffer that has already received a data frame? is a receive message buffer whose dn bit has been set to 1. remark a remote frame is received and stored, regardless of the setting of ows bit and dn bit. a remote frame that satisfies the other conditions (id matches, rtr = 0, trq = 0) is always received and stored in t he corresponding message buffer (interrupt generated, dn flag set, mdlc [3:0] bits upda ted, and recorded to the receive history list). rtr remote frame request bit note 0 transmit a data frame. 1 transmit a remote frame. note the rtr bit specifies the type of message frame that is transmitted from a message buffer defined as a transmit message buffer. even if a valid remote frame has been received, rtr of the transmit message bu ffer that has received the frame remains cleared to 0. even if a remote frame whose id matches has been received from the can bus with the rtr bit of the transmit message buffer set to 1 to trans mit a remote frame, that remote frame is not received or stored (interrupt generated, dn flag set, mdlc [3:0] bits updated, and recorded to the receive history list). mt2 mt1 mt0 message buffer type setting bit 0 0 0 transmit message buffer 0 0 1 receive message buffer (no mask setting) 0 1 0 receive message buffer (mask 1 set) 0 1 1 receive message buffer (mask 2 set) 1 0 0 receive message buffer (mask 3 set) 1 0 1 receive message buffer (mask 4 set) other than above setting prohibited
chapter 16 can controller user?s manual u19180ej1v0ud 527 ma0 message buffer assignment bit 0 message buffer not used. 1 message buffer used. caution be sure to write 0 to bits 2 and 1. (22) can message id register m (c0midlm, c0midhm) the c0midlm and c0midhm registers ar e used to set an identifier (id). after reset: undefined r/w address: see table 16-16 15 14 13 12 11 10 9 8 c0midlm id15 id14 id13 id12 id11 id10 id9 id8 7 6 5 4 3 2 1 0 id7 id6 id5 id4 id3 id2 id1 id0 15 14 13 12 11 10 9 8 c0midhm ide 0 0 id28 id27 id26 id25 id24 7 6 5 4 3 2 1 0 id23 id22 id21 id20 id19 id18 id17 id16 ide format mode specification bit 0 standard format mode (id28 to id18: 11 bits) note 1 extended format mode (id28 to id0: 29 bits) note the id17 to id0 bits are not used. id28 to id0 message id id28 to id18 standard id value of 11 bits (when ide = 0) id28 to id0 extended id value of 29 bits (when ide = 1) cautions 1. be sure to write 0 to bits 14 and 13 of the c0midhm register. 2. be sure to align the id value according to the given bit positions into this registers. note that for standard id, the id value must be shifted to fit into id28 to id11 bit positions.
chapter 16 can controller user?s manual u19180ej1v0ud 528 (23) can message control register m (c0mctrlm) the c0mctrlm register is used to cont rol the operation of the message buffer. after reset: 00x000000 00000000b r/w address: see table 16-16 . (a) read 15 14 13 12 11 10 9 8 c0mctrlm 0 0 muc 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 0 mow ie dn trq rdy (b) write 15 14 13 12 11 10 9 8 c0mctrlm 0 0 0 0 set ie 0 set trq set rdy 7 6 5 4 3 2 1 0 0 0 0 clear mow clear ie clear dn clear trq clear rdy (a) read muc note message buffer data updating bit 0 the can module is not updating the message buffer (reception and storage). 1 the can module is updating the message buffer (reception and storage). note the muc bit is undefined until the first reception and storage is performed. mow message buffer overwrite status bit 0 the message buffer is not overwritten by a newly received data frame. 1 the message buffer is overwritten by a newly received data frame. remark mow bit is not set to 1 even if a remote frame is received and stored in the transmit message buffer with dn = 1. ie message buffer interrupt request enable bit 0 receive message buffer: valid message reception completion interrupt disabled. transmit message buffer: normal message trans mission completion interrupt disabled. 1 receive message buffer: valid message reception completion interrupt enabled. transmit message buffer: normal message tr ansmission completion interrupt enabled.
chapter 16 can controller user?s manual u19180ej1v0ud 529 dn message buffer data updating bit 0 a data frame or remote frame is not stored in the message buffer. 1 a data frame or remote frame is stored in the message buffer. trq message buffer transmission request bit 0 no message frame transmitting request that is pending or being transmitted is in the message buffer. 1 the message buffer is holding transmission of a message frame pending or is transmitting a message frame. caution do not set the trq bit and the rdy bit (1) at the same time. set the rdy bit (1) before setting the trq bit. rdy message buffer ready bit 0 the message buffer can be written by software . the can module cannot write to the message buffer. 1 writing the message buffer by software is ignored (except a write access to the rdy, trq, dn, and mow bits). the can module can write to the message buffer. cautions 1. do not clear the rdy bit (0) during message transmission. follow the transmission abort process about clearing the rdy bit (0) for redefinition of the message buffer. 2. clear again when rdy bit is not cleared even if this bit is cleared. 3. be sure that rdy is cleared before writing to the message buffer registers. perform this confirmation by reading b ack the rdy bit. however, setting the t r bit, clearing the dn bit, setting the rdy bit or clear ing the mow bit of the c0mctrlm register need not be confirmed. (b) write clear mow setting of mow bit 0 mow bit is not changed. 1 mow bit is cleared to 0. set ie clear ie setting of ie bit 0 1 ie bit is cleared to 0. 1 0 ie bit is set to 1. other than above ie bit is not changed. caution set ie bit and rdy bit always separately. clear dn setting of dn bit 0 dn bit is not changed. 1 dn bit is cleared to 0. caution do not set the dn bit to 1 by software. be sure to write 0 to bit 10.
chapter 16 can controller user?s manual u19180ej1v0ud 530 set trq clear trq setting of trq bit 0 1 trq bit is cleared to 0. 1 0 trq bit is set to 1. other than above trq bit is not changed. caution while receiving a message from another node or transmitting the messages, there is a possibility of not to begin immediately the transmission even if the trq bit is set to 1. the transmission is not aborted even if the trq bit is cleared to 0. the transmission is continued if a message is currently being transmitted and until the transmission is completed (successfully or not). set rdy clear rdy setting of rdy bit 0 1 rdy bit is cleared to 0. 1 0 rdy bit is set to 1. other than above rdy bit is not changed. caution set ie bit and rdy bit always separately.
chapter 16 can controller user?s manual u19180ej1v0ud 531 16.8 can controller initialization 16.8.1 initialization of can module before the can module operation is enabled, the can module system clock needs to be determined by setting the ccp[3:0] bits of the c0gmcs register by software. do not change the setting of the can module system clock after can module operation is enabled. the can module is enabled by setting t he gom bit of the c0gmctrl register. for the procedure of initializ ing the can module, refer to 16.16 operation of can controller. 16.8.2 initialization of message buffer after the can module is enabled, the message buffers cont ain undefined values. a minimum initialization for all the message buffers, even for those not used in the applicat ion, is necessary before switching the can module from the initialization mode to one of the operation modes. - clear the rdy, trq, and dn bits of the c0mctrlm register to 0. - clear the ma0 bit of the c0mconfm register to 0. remark m = 0 to 15 16.8.3 redefinition of message buffer redefining a message buffer means changing the id and control information of the message buffer while a message is being received or transmitted, without affecting other transmiss ion/reception operations. (1) to redefine message buffer in initialization mode place the can module in the initia lization mode once and then change t he id and control information of the message buffer in the initialization mode. after chang ing the id and control information, set the can module in an operation mode. (2) to redefine message buffer during reception perform redefinition as shown in figure 16-40. (3) to redefine message buffer during transmission to rewrite the contents of a transmit message buffe r to which a transmission request has been set, perform transmission abort processing (refer to 16.10.4 (1) transmission abort process except for in normal operation mode with automatic block transmission (abt) and 16.10.4 (2) transmission abort process except for abt transmission in normal operation mode with automatic block transmission (abt) . confirm that transmission has been aborted or comple ted, and then redefine the message buffer. after redefining the transmit message buffer, set a transmissio n request using the procedure described below. when setting a transmission request to a message buffe r that has been redefi ned without aborting the transmission in progress, however, the 1-bit wait time is not necessary.
chapter 16 can controller user?s manual u19180ej1v0ud 532 figure 16-27. setting transmission request (trq) to transmit message buffer after redefining end redefinition completed execute transmission? wait for 1 bit of can data. set trq bit set trq = 1 clear trq = 0 yes no cautions 1. when a message is received, reception filtering is performed in accordance with the id and mask set to each receive message buffer. if the procedure in figure 16-40 is not observed, the contents of the message buffer after it has been redefined may contradict the result of reception (result of reception filtering). if this happens, check that the id and ide received first and stored in the message buffer following redefinition are those stored after the message buffer has been redefined. if no id and ide are stored after redefinition, redefine the message buffer again. 2. when a message is transmitted, the transmission priority is checked in accordance with the id, ide, and rtr bits set to each transmit message buffer to which a transmission request was set. the transmit message buffer having the highest priority is selected for transmission. if the procedure in figure 16-41 is not observed, a message with an id not having the highest priority may be transmitted after redefinition. 16.8.4 transition from initializ ation mode to operation mode the can module can be switched to the following operation modes. - normal operation mode - normal operation mode with abt - receive-only mode - single-shot mode - self-test mode
chapter 16 can controller user?s manual u19180ej1v0ud 533 figure 16-28. transition to operation modes can module channel invalid [receive-only mode] opmode[2:0]=03h opmode[2:0] = 00h and can bus is busy. opmode[2:0] = 03h [single-shot mode] opmode[2:0]=04h opmode[2:0] = 04h opmode[2:0] = 05h init mode opmode[2:0] = 00h efsd = 1 and gom = 0 all can modules are in init mode and gom = 0 gom = 1 reset reset released [normal operation mode with abt] opmode[2:0]=02h opmode[2:0] = 00h and can bus is busy. opmode[2:0] = 00h and interframe space opmode[2:0] = 02h opmode[2:0] = 01h opmode[2:0] = 00h and can bus is busy. [normal operation mode] opmode[2:0]=01h opmode[2:0] = 00h and can bus is busy. opmode[2:0] = 00h and interframe space opmode[2:0] = 00h and interframe space opmode[2:0] = 00h and interframe space opmode[2:0] = 00h and interframe space opmode[2:0] = 00h and can bus is busy. [self-test mode] opmode[2:0]=05h the transition from the initia lization mode to an operation mode is controll ed by the bit string opmode [2:0] in the c0ctrl register. changing from one operation mode into another requires sh ifting to the initialization mode in between. do not change one operation mode to another directly; ot herwise the operation will not be guaranteed. requests for transition from the operat ion mode to the initialization mode are held pending when the can bus is not in the interframe space (i.e., frame reception or tr ansmission is in progress), and the can module enters the initialization mode at the first bit in the interframe space (the value of opmo de [2:0] are changed to 00h). after issuing a request to change the mode to the initialization mode, read the opmode [2:0] bi ts until their value becomes 000b to confirm that the module has enter ed the initialization mode (refer to figure 16-37 ). 16.8.5 resetting error counter c0erc of can module if it is necessary to reset the can module error counter c0erc and the can module information register c0info when re-initialization or forced recovery from the bus-off st ate is made, set the ccerc bit of the c0ctrl register to 1 in the initialization mode. when this bit is set to 1, the can module error counter c0erc and the can module information register c0 info are cleared to their default values.
chapter 16 can controller user?s manual u19180ej1v0ud 534 16.9 message reception 16.9.1 message reception in all the operation modes, the complete message buffer area is analyzed to find a suitable buffer to store a newly received message. all message buffers satisfying the followi ng conditions are included in that evaluation (rx-search process). - used as a message buffer (ma0 bit of c0mconfm register set to 1b.) - set as a receive message buffer (mt [2:0] bits of c0mconfm register set to 001b, 010b, 011b, 100b, or 101b.) - ready for reception (rdy bit of c0mctrlm register set to 1.) when two or more message buffers of the can module receive a message, the message is stored according to the priority explained below. the message is always stored in the message buffer with the highest priority, not in a message buffer with a low priority. for example, when an unmasked receive message buffer and a receive message buffer linked to mask 1 have the same id, the received message is not stored in the message buffer linked to mask 1, even if that message buffer has not received a message a nd a message has already been received in the unmasked receive message buffer. in other words, when a condition has been set to store a message in two or more message buffers with different priorities, the message buffer with t he highest priority always stores the message; the message is not stored in message buffers with a lower priority. this also applies when the message buffer with the highest priority is unable to receive and store a message (i.e., when dn = 1 indicating that a message has already been received, but rewriting is disabled because ows = 0). in th is case, the message is not actually received and stored in the candidate message buffer with the highest priority, but neith er is it stored in a message buffer with a lower priority. priority storing condition if same id is set 1 (high) unmasked message buffer dn = 0 dn = 1 and ows = 1 2 message buffer linked to mask 1 dn = 0 dn = 1 and ows = 1 3 message buffer linked to mask 2 dn = 0 dn = 1 and ows = 1 4 message buffer linked to mask 3 dn = 0 dn = 1 and ows = 1 5(low) message buffer linked to mask 4 dn = 0 dn = 1 and ows = 1 remark m = 0 to 15
chapter 16 can controller user?s manual u19180ej1v0ud 535 16.9.2 receive data read to keep data consistency when reading can message buffe rs, perform the data reading according to figure 16-51 to 16-53. during message reception, the can module sets dn of t he c0mctrlm register two time s: at the beginning of the storage process of data to the message buffer, and again at the end of this storage process. during this storage process, the muc bit of the c0mctrlm regist er of the message buffer is set. (refer to figure 16-29 .) the receive history list is also updated just before the storage process. in addition, during storage process (muc = 1), the rdy bit of the c0mctrl register of the message buffe r is locked to avoid the coincidental data wr by cpu. note the storage process may be disturbed (del ayed) when the cpu accesses the message buffer. figure 16-29. dn and muc bit setting period (for standard id format) sof (1) id ide rtr r0 dlc data0-data7 crc ack eof can std id format (11) (1) (1) (1) (4) (0-64) (16) (2) recessive dominant dn muc message store mdata,mdlc.midx- > mbuf (7) set dn & clear muc at the same timing cints1 set dn & muc at the same time ifs intrec1 operation of the can contoroller remark m = 0 to 15
chapter 16 can controller user?s manual u19180ej1v0ud 536 16.9.3 receive history list function the receive history list (rhl) function records in the re ceive history list the number of the receive message buffer in which each data frame or remote frame was received and stored. the rhl consists of storage elements equivalent to up to 23 messages, the last in-message pointer (lipt) with the corresponding c0lipt register and the receive history list get pointer (rgpt) with the corresponding c0rgpt register. the rhl is undefined immediately after t he transition of the can module from the initialization mode to one of the operation modes. the c0lipt register holds the contents of the rhl element indicated by the value of the lipt poi nter minus 1. by reading the c0lipt register, therefore, the number of t he message buffer that receiv ed and stored a data frame or remote frame first can be checked. the lipt pointer is ut ilized as a write pointer that indicates to what part of the rhl a message buffer number is recorded. any time a dat a frame or remote frame is received and stored, the corresponding message buffer number is recorded to the rhl element indicated by the lipt pointer. each time recording to the rhl has been completed, the lipt pointer is automatically incremented. in this way, the number of the message buffer that has received and st ored a frame will be recorded chronologically. the rgpt pointer is utilized as a read pointer that reads a recorded message buffer number from the rhl. this pointer indicates the first rhl element that the cpu has not read yet. by readi ng the c0rgpt register by software, the number of a message buffer that has re ceived and stored a data frame or remote frame can be read. each time a message buffer number is read from the c0rgpt regist er, the rgpt pointer is automatically incremented. if the value of the rgpt pointer matc hes the value of the lipt pointer, t he rhpm bit (receive history list pointer match) of the c0rgpt register is set to 1. this i ndicates that no message buffer nu mber that has not been read remains in the rhl. if a new message buffer number is re corded, the lipt pointer is incremented and because its value no longer matches the value of the rgpt pointer, the rhpm bit is cleared. in other words, the numbers of the unread message buffers exist in the rhl. if the lipt pointer is incr emented and matches the value of the rgpt pointer minus 1, the rovf bit (receive history list overflow) of the c0rgpt regi ster is set to 1. this indicates t hat the rhl is full of numbers of message buffers that have not been read. when further message re ception and storing occur, the last recorded message buffer number is overwritten by the number of the message bu ffer that received and stored the new message. in this case, after the rovf bit has been set (1), the recorded message buffer numbers in the rhl do not completely reflect the chronological order. however messages itself are not lost and can be located by cpu search in message buffer memory with the help of the dn bit. caution if the history list is in the overflow conditi on (rovf is set), reading the history list contents is still possible, until the history list is empty (i ndicated by rhpm flag set). nevertheless, the history list remains in the overflow condition, unti l rovf is cleared by software. if rovf is not cleared, the rhpm flag will also not be updated (cleared) upon a message storage of newly received frame. this may lead to the situat ion, that rhpm indicates an empty history list, although a reception has taken place, while the history list is in the overflow state (rovf and rhpm are set).
chapter 16 can controller user?s manual u19180ej1v0ud 537 as long as the rhl contains 23 or less entries the sequence of occurrence is main tained. if more receptions occur without reading the rhl by the host processor, comp lete sequence of receptions can not be recovered. figure 16-30. receive history list last in- massage pointer (lipt) receive history list get pointer (rgpt) - message buffer 6, 9, 2, and 7 are read by host processor. - newly received messages are stored in message buffer 3, 4, and 8. event: receive history list get pointer (rgpt) last in- massage pointer (lipt) - 20 other massages are received. message buffer 6 carries last received message. - upon reception in message buffer 6, rhl is full. - rovf is set. event: last in- massage pointer (lipt) last in- massage pointer (lipt) receive history list get pointer (rgpt) receive history list get pointer (rgpt) receive history list (rhl) message buffer 6 message buffer 9 message buffer 2 message buffer 7 0 1 2 3 4 5 6 7 22 23 : : : receive history list (rhl) message buffer 3 message buffer 4 message buffer 8 0 1 2 3 4 5 6 7 22 23 : : : receive history list (rhl) message buffer 10 message buffer 11 message buffer 6 message buffer 3 message buffer 4 message buffer 8 message buffer 5 message buffer9 message buffer1 0 1 2 3 4 5 6 7 22 23 : : : - reception in message buffer13, 14, and 15 occurs. - overflow situation occurs. event: receive history list (rhl) message buffer 10 message buffer 11 message buffer 15 message buffer 3 message buffer 4 message buffer 8 message buffer 5 message buffer 9 message buffer 1 0 1 2 3 4 5 6 7 22 23 : : : rovf = 1 lipt is locked rovf = 1 lipt is locked rovf = 1 denotes that lipt equals rgpt ? 1 while message buffer number stored to element indicated by lipt ? 1.
chapter 16 can controller user?s manual u19180ej1v0ud 538 16.9.4 mask function for any message buffer, which is used fo r reception, the assignmen t to one of four global reception masks (or no mask) can be selected. by using the mask function, the message id comparison can be reduced by masked bits, herewith allowing the reception of several different ids into one buffer. while the mask function is in effect, an identifier bit that is defined to be "1" by a mask in the received message is not compared with the corresponding identifier bit in the message buffer. however, this comparison is performed for any bi t whose value is defined as "0" by the mask. for example, let us assume that a ll messages that have a standard-format id , in which bits id27 to id25 are "0" and bits id24 and id22 are "1", are to be stored in message buffer 14. the procedure for this example is shown below. <1> identifier to be stored in message buffer id28 id27 id26 id25 id24 id23 id22 id21 id20 id19 id18 x 0 0 0 1 x 1 x x x x x = don?t care <2> identifier to be configured in message buffer 14 (example) (using cann message id registers l14 and h14 (c0midl14 and c0midh14)) id28 id27 id26 id25 id24 id23 id22 id21 id20 id19 id18 x 0 0 0 1 x 1 x x x x id17 id16 id15 id14 id13 id12 id11 id10 id9 id8 id7 x x x x x x x x x x x id6 id5 id4 id3 id2 id1 id0 x x x x x x x id with id27 to id25 cleared to "0" and id24 and id22 set to "1" is registered (initialized) to message buffer 14. remark message buffer 14 is set as a standard format i dentifier that is linked to mask 1 (mt [2:0] of c0mconf14 register are set to 010b).
chapter 16 can controller user?s manual u19180ej1v0ud 539 <3> mask setting for can module 1 (mask 1) (example) (using can1 address mask 1 registers l and h (c1mask1l and c1mask1h)) cmid28 cmid27 cmid26 cmid25 cmid24 cmid23 cmid22 cmid21 cmid20 cmid19 cmid18 1 0 0 0 0 1 0 1 1 1 1 cmid17 cmid16 cmid15 cmid14 cmid13 cmid12 cmid11 cmid10 cmid9 cmid8 cmid7 1 1 1 1 1 1 1 1 1 1 1 cmid6 cmid5 cmid4 cmid3 cmid2 cmid1 cmid0 1 1 1 1 1 1 1 1: not compared (masked) 0: compared the cmid27 to cmid24 and cmid22 bits are cleared to "0", and cmid28, cmid23, and cmid21 to cmid0 bits are set to "1".
chapter 16 can controller user?s manual u19180ej1v0ud 540 16.9.5 multi buffer receive block function the multi buffer receive block (mbrb) function is used to store a block of data in two or more message buffers sequentially with no cpu interaction, by setting the same id to two or more message buffers with the same message buffer type. suppose, for example, the same message buffer type is set to 5 message buffers, message buffers 10 to 14, and the same id is set to each message bu ffer. if the first message whose id ma tches the id of the message buffers is received, it is stored in message buffer 10. at this point, the dn bit of message buffer 10 is set, prohibiting overwriting the message buffer when subsequent messages are received. if the next message with a matching id is received, it is received and stored in message buffer 11. each time a message with a matching id is received, it is sequentiall y (in the ascending order) stored in message buffers 12, 13, and 14. even when a data block consisting of multip le messages is received, the messages can be stored and received without overwriting the prev iously received matching-id data. whether a data block has been received and stored can be checked by setting the ie bit of the c0mctrlm register of each message buffer. fo r example, if a data block consists of k messages, k message buffers are initialized for reception of the data block. the ie bit in message buffers 0 to (k ? 2) is cleared to 0 (interrupts disabled), and the ie bit in message buffer k ? 1 is set to 1 (interrupts enabled). in this case, a reception completion interrupt occurs when a message has been received and stored in message buffer k ? 1, indicating that mbrb has become full. alternatively, by clearing the ie bit of message buffers 0 to (k ? 3) and setting the ie bit of message buffer k ? 2, a warning that mbrb is about to overflow can be issued. the basic conditions of storing receive data in each messa ge buffer for the mbrb are the same as the conditions of storing data in a single message buffer. cautions 1. mbrb can be configured for each of th e same message buffer types. therefore, even if a message buffer of another mbrb whose id ma tches but whose message buffer type is different has a vacancy, the received message is not stored in that message buffer, but instead discarded. 2. mbrb does not have a ring buffer structure. therefore, after a message is stored in the message buffer having the highest number in the mbrb configuration, a newly received message will not be stored in the message buffer having the lowest message buffer number. 3. mbrb operates based on th e reception and storage condi tions; there are no settings dedicated to mbrb, such as function enable bits. by setting the same message buffer type and id to two or more message buffe rs, mbrb is automatically configured. 4. with mbrb, "matching id" means "matching id after mask". even if the id set to each message buffer is not the same, if the id that is masked by the mask register matches, it is considered a matching id and the buffer that has this id is treated as the storage destination of a message. 5. the priority between mbrbs is mentioned in 16.9.1 message reception. remark m = 0 to 15
chapter 16 can controller user?s manual u19180ej1v0ud 541 16.9.6 remote frame reception in all the operation modes, when a remote frame is receiv ed, the message buffer that is to store the remote frame is searched from all the message buffers satisfying the following conditions. - used as a message buffer (ma0 bit of c0mconfm register set to 1b.) - set as a transmit message buffer (mt [2:0] bits in c0mcon fm register set to 000b) - ready for reception (rdy bit of c0mctrlm register set to 1.) - set to transmit message (rtr bit of c0mconfm register is cleared to 0.) - transmission request is not set. (trq bit of c0mctrlm register is cleared to 0.) upon acceptance of a remote frame, the following action s are executed if the id of the received remote frame matches the id of a message buffer that satisfies the above conditions. - the mdlc [3:0] bit string in the c0mdlcm register stores the received dlc value. - c0mdata0m to c0mdata7m in the data area are not updated (data before reception is saved). - the dn bit of the c0mctrlm register is set to 1. - the cints1 bit of the c0ints register is set to 1 (if the ie bit in the c0mctrlm register of the message buffer that receives and stores the frame is set to 1). - the reception completion interrupt (int c0rec) is output (if the ie bit in the c0mctrlm register of the message buffer that receives and stores the frame is set to 1 and if the cie1 bit of the c0ie register is set to 1). - the message buffer number is recorded to the receive history list. caution when a message buffer is searched for receiving and storing a remote frame, overwrite control by the ows bit of the c0mconfm register of the message buffer and the dn bit of the c0mctrlm register are not aff ected. the setting of ows is i gnored, and dn is set in any case. if more than one transmit message buffer has the same id and the id of the received remote frame matches that id, the remote frame is stored in the transmit message buffer with the lowest message buffer number. remark m = 0 to 15
chapter 16 can controller user?s manual u19180ej1v0ud 542 16.10 message transmission 16.10.1 message transmission in all the operation modes, if the trq bit is set to 1 in a message buffer that satisfies the following conditions, the message buffer that is to tr ansmit a message is searched. - used as a message buffer (ma0 bit of c0mconfm register set to 1b.) - set as a transmit message buffer (mt [2:0] bits of c0mcon fm register set to 000b.) - ready for transmission (rdy bit of c0mctrlm register set to 1.) the can system is a multi-master communication system . in a system like this, the priority of message transmission is determined based on message identifiers (ids). to facilitate tr ansmission processing by software when there are several messages awaiting transmission, t he can module uses hardware to check the id of the message with the highest priority and automatically identifies that message. this eliminates the need for software- based priority control. transmission priority is controlled by the identifier (id). figure 16-31. message processing example message no. the can module transmits messages in the following sequence. message waiting to be transmitted id = 120h id = 229h id = 223h id = 023h id = 123h 0 1 2 3 4 5 6 7 8 9 1. message 6 2. message 1 3. message 8 4. message 5 5. message 2 after the transmit message search, the transmit message with the highest priority of the transmit message buffers that have a pending transmission request (message buffers with the trq bit set to 1 in advance) is transmitted. if a new transmission request is set, the transmit message buffer with the new transmission request is compared with the transmit message buffer with a pending transmissi on request. if the new transmission request has a higher priority, it is transmitted, unless transmi ssion of a message with a low priority has already started. if transmission of a message with a low priority has already started, however, the new transmission request is transmitted later. to solve this priority inversion effect, the software can perform a transmission abort request for the lower priority message. the highest priority is determined according to the following rules.
chapter 16 can controller user?s manual u19180ej1v0ud 543 priority conditions description 1(high) value of first 11 bits of id [id28 to id18]: the message frame with the lowest value represented by the first 11 bits of the id is transmitted first. if the value of an 11-bit standard id is equal to or smaller than the first 11 bits of a 29-bit extended id, the 11-bit standard id has a higher priority than message frame with the 29-bit extended id. 2 frame type a data frame with an 11-bit standard id (rtr bit is cleared to 0) has a higher priority than a remote frame with a standard id and a message frame with an extended id. 3 id type a message frame with a standard id (ide bit is cleared to 0) has a higher priority than a message frame with an extended id. 4 value of lower 18 bits of id [id17 to id0]: if more than one transmission-pending extended id message frame have equal values in the first 11 bi ts of the id and the same frame type (equal rtr bit values), the message frame with the lowest value in the lower 18 bits of its extended id is transmitted first. 5(low) message buffer number if two or more message buffers request transmission of message frames with the same id, the message from the message buffer with the lowest message buffer number is transmitted first. remarks 1. if automatic block transmission request bit abttrg is set to 1 in the normal operation mode with abt, the trq bit is set to 1 only for one message buffer in the abt message buffer group. if the abt mode was triggered by abttrg bit, one tr q bit is set to 1 in the abt area (buffer 0 through 7). beyond this trq bit, the application ca n request transmissions (set trq to 1) for other tx-message buffers that do not belong to the abt area. in that case an interval arbitration process (tx-search) evaluates all tx-message buffers with trq bit set to 1 and chooses the message buffer that contains the highest priori tized identifier for the next transmission. if there are 2 or more identifiers that have the highest priority (i.e. ident ical identifiers), the message located at the lowest message buffer number is transmitted at first. upon successful transmission of a message fr ame, the following operations are performed. - the trq flag of the corresponding transmit message buffer is automatically cleared to 0. - the transmission completion status bit cints0 of the c0ints register is set to 1 (if the interrupt enable bit (ie) of the corresponding transmit message buffer is set to 1). - an interrupt request signal intc0trx output (if the cie0 bit of the c0ie register is set to 1 and if the interrupt enable bit (ie) of the corres ponding transmit message buffer is set to 1). 2. when changing the contents of a transmit buffer, t he rdy flag of this buffer must be cleared before updating the buffer contents. as during internal transfer actions, the rdy flag may be locked temporarily, the status of rdy must be checked by software, after changing it. 3. m = 0 to 15
chapter 16 can controller user?s manual u19180ej1v0ud 544 16.10.2 transmit history list function the transmit history list (thl) function records in the tr ansmit history list the number of the transmit message buffer from which data or remote frames have been were sent. t he thl consists of storage elem ents equivalent to up to seven messages, the last out-message pointer (lopt) wi th the corresponding c0lopt register, and the transmit history list get pointer (tgpt) with the corresponding c0tgpt register. the thl is undefined immediately after the transition of the can module from the initializat ion mode to one of the operation modes. the c0lopt register holds the contents of the thl element indicated by the value of the lopt pointer minus 1. by reading the c0lopt register, theref ore, the number of the message buffer t hat transmitted a data frame or remote frame first can be checked. the lopt poi nter is utilized as a write pointer that indicates to what part of the thl a message buffer number is reco rded. any time a data frame or remote frame is transmitted, the corresponding message buffer number is recorded to the thl element indica ted by the lopt pointer. each time recording to the thl has been completed, the lopt pointer is automatically incremented. in this way, the number of the message buffer that has received and stored a frame will be recorded chronologically. the tgpt pointer is utilized as a read pointer that reads a recorded message buffer number from the thl. this pointer indicates the first thl element that the cpu has not yet read. by reading the c0tgpt register by software, the number of a message buffer that has completed transmissi on can be read. each time a message buffer number is read from the c0tgpt register, the tg pt pointer is automatically incremented. if the value of the tgpt pointer matches the value of the lopt pointer, the th pm bit (transmit history list pointer match) of the c0tgpt register is set to 1. this indicates that no messag e buffer numbers that have not been read remain in the thl. if a new message buffer number is re corded, the lopt pointer is incremented and because its value no longer matches the value of the tgpt pointer, the th pm bit is cleared. in other words, the numbers of the unread message buffers exist in the thl. if the lopt pointer is incr emented and matches the value of the tgpt pointer minus 1, the tovf bit (transmit history list overflow) of the c0tgpt regi ster is set to 1. this indicates t hat the thl is full of message buffer numbers that have not been read. if a new message is received and stored, the message buffer number recorded last is overwritten by the number of the mess age buffer that transmitted its message a fterwards. after the tovf bit has been set (1), therefore, the recorded message buffer numbers in the thl do not completely reflect the chronological order. however the other transmitted messages can be found by a cpu search applied to all transmit message buffers unless the cpu has not overwritten a transmit object in one of these buffers befo rehand. in tota l up to six transmission completions can occur without overflowing the thl. caution if the history list is in the overflow condition (tovf is set), reading the history list contents is still possible, until the history list is empty (indi cated by thpm flag set). nevertheless, the history list remains in the overflow condition, until tovf is cleared by software. if tovf is not cleared, the thpm flag will also not be updated (cleared) upon successful transmission of a new message. this may lead to the situation, that thpm indicates an empty history list, although a successful transmission has taken place, while the history list is in the overflow state (tovf and thpm are set). remark m = 0 to 15
chapter 16 can controller user?s manual u19180ej1v0ud 545 figure 16-32. transmit history list last out- message pointer (lopt) - cpu confirms tx completion of message buffer 6, 9, and 2. - tx completion of message buffer 3, and 4. event: transmit history list get pointer (tgpt) - message buffer 8, 5, 6, and 10 completes transmission. - thl is full. - tovf is set. event: transmit history list (thl) message buffer 6 message buffer 9 message buffer 2 message buffer 7 0 1 2 3 4 5 6 7 - message buffer11, 13, and 14 completes transmission. - overflow situation occurs. event: tovf = 1 lopt is locked tovf = 1 lopt is locked tovf = 1 denotes that lopt equals tgpt ? 1 while message buffer number stor ed to element indicated by lopt ? 1. last out- message pointer (lopt) transmit history list get pointer (tgpt) transmit history list (thl) message buffer 7 message buffer 3 message buffer 4 0 1 2 3 4 5 6 7 transmit history list (thl) message buffer 6 message buffer 10 message buffer 7 message buffer 3 message buffer 4 message buffer 8 message buffer 5 0 1 2 3 4 5 6 7 last out- message pointer (lopt) transmit history list get pointer (tgpt) transmit history list (thl) message buffer 6 message buffer 14 message buffer 7 message buffer 3 message buffer 4 message buffer 8 message buffer 5 0 1 2 3 4 5 6 7 last out- message pointer (lopt) transmit history list get pointer (tgpt)
chapter 16 can controller user?s manual u19180ej1v0ud 546 16.10.3 automatic block transmission (abt) the automatic block transmission (abt) function is used to transmit two or more data frames successively with no cpu interaction. the maximum number of transmit message buffers assigned to the abt function is eight (message buffer numbers 0 to 7). by setting opmode [2:0] bits of the c0ctrl register to 010b, "normal operation mode with automatic block transmission function" (hereafter referr ed to as abt mode) can be selected. to issue an abt transmission request, define the message buffers by software first. set the ma0 bit (1) in all the message buffers used for abt, and define all the buffers as transmit message buffers by setti ng mt [2:0] bits to 000b. be sure to set the id for each mess age buffer for abt even when the same id is being used for all the message buffers. to use two or more ids, set the id of each message buffer by using the c0midlm and c0midhm registers. set the c0mdlcm and c0mdata0m to c0mdata7m regist ers before issuing a transmission request for the abt function. after initialization of message buffers for abt is finished, the rdy bit needs to be set (1). in the abt mode, the trq bit does not have to be manipulated by software. after the data for the abt message buffers has been pr epared, set the abttrg bit to 1. automatic block transmission is then started. when abt is started, the trq bit in the first message buffer (message buffer 0) is automatically set to 1. after transmi ssion of the data of message buffer 0 has fi nished, trq bit of the next message buffer, message buffer 1, is set aut omatically. in this way, trans mission is executed successively. a delay time can be inserted by program in the interval in which the transmission requ est (trq) is automatically set while successive transmission is being executed. the delay time to be inserted is defined by the c0gmabtd register. the unit of the delay time is dbt (data bit time). dbt depends on the setting of the c0brp and c0btr registers. among transmit objects within the abt-area, the priority of the transmission id is not evaluated. the data of message buffers 0 to 7 are sequentially transmitted. w hen transmission of the data fram e from message buffer 7 has been completed, the abttrg bit is automatically cleared to 0 and the abt operation is finished. if the rdy bit of an abt message buffer is cleared during abt, no data frame is transmitted from that buffer, abt is stopped, and the abttrg bit is clear ed. after that, transmission can be resumed from the message buffer where abt stopped, by setting the rdy and abttrg bits to 1 by so ftware. to not resume transmission from the message buffer where abt stopped, the internal abt engine can be reset by setting the abtclr bit to 1 while abt mode is stopped and abttrg bit is cleared to 0. in this case, transmission is started from message buffer 0 if the abtclr bit is cleared to 0 and then th e abttrg bit is set to 1. an interrupt can be used to check if data frames have been transmitted from all the message buffers for abt. to do so, the ie bit of the c0mctrlm r egister of each message buffer except the last message buffer needs to be cleared (0). if a transmit message buffer other than those used by th e abt function (message buffer 8 to 15) is assigned to a transmit message buffer, the message to be transmitted next is det ermined by the priority of the transmission id of the abt message buffer whose transmission is currently held pending and the transmission id of the message buffers other than those used by the abt function. transmission of a data frame from an abt message buffer is not recorded in the transmit history list (thl).
chapter 16 can controller user?s manual u19180ej1v0ud 547 cautions 1. set the abtclr bit to 1 while the abttrg bit is cleared to 0 in order to resume abt operation at buffer no.0. if the abtclr bit is set to 1 while the abttrg bit is set to 1, the subsequent operation is not guaranteed. 2. if the automatic block tr ansmission engine is cleared by setting the abtclr bit to 1, the abtclr bit is automatically cleared immediately after the processing of the clearing request is completed. 3. do not set the abttrg bit in the initialization mode. if the abttrg bit is set in the initialization mode, the proper operation is not guaranteed after the mode is changed from the initialization mode to the abt mode. 4. do not set trq bit of the abt messag e buffers to 1 by software in the normal operation mode with abt. otherwise, the operation is not guaranteed. 5. the c0gmabtd register is used to set the delay time that is inserted in the period from completion of the preceding abt message to setting of the trq bit for the next abt message when the transmission requests are set in the order of message numbers for each message for abt that is successively transmitted in the abt mode. the timing at which the messages are actually transmitted onto the can bus varies depending on the status of transmission from other stations and the status of the setting of the transmission request for messages other than the abt messages (message buffer 8 to 15). 6. if a transmission request is made for a message other than an abt message and if no delay time is inserted in the interval in which transmission requests for abt are automatically set (c0gmabtd = 00h), messages other than abt messages may be transmitted not depending on the priority of the abt message. 7. do not clear the rdy bit to 0 when abttrg = 1. 8. if a message is received from another node while normal operation mode with abt is active, the tx-message from the abt-area may be transmitted with delay of one frame although c0gmabtd register was set up with 00h. remark m = 0 to 15 16.10.4 transmission abort process (1) transmission abort process except for in normal op eration mode with automatic block transmission (abt) the user can clear the trq bit of the c0mctrlm regi ster to 0 to abort a transmission request. the trq bit will be cleared immediately if the abort was successful . whether the transmission was successfully aborted or not can be checked using the tsta t bit of the c0ctrl register and t he c0tgpt register, which indicate the transmission status on the can bus (for details, refer to the processing in figure 16-47 ). (2) transmission abort process except for abt transmission in normal operation mode with automatic block transmission (abt) the user can clear the abttrg bit of the c0gmabt register to 0 to abort a transmission request. after checking the abttrg bit of the c0gmabt register = 0, clear the trq bit of the c0mctrlm register to 0. the trq bit will be cleared immediately if the abort was successful. whether the transmission was successfully aborted or not can be checked using the tstat bit of t he c0ctrl register and the c0tgpt register, which indicate the transmission status on the can bus (for details, refer to the processing in figure 16-48 ).
chapter 16 can controller user?s manual u19180ej1v0ud 548 (3) transmission abort process for abt transmission in normal operation mode with automatic block transmission (abt) to abort abt that is already started, clear the abttrg bit of the c0gmabt register to 0. in this case, the abttrg bit remains 1 if an abt message is curr ently being transmitted and until the transmission is completed (successfully or not), and is cleared to 0 as soon as transmission is finished. this aborts abt. if the last transmission (before abt) was successful, t he normal operation mode with abt is left with the internal abt pointer pointing to the next message buffer to be transmitted. in the case of an erroneous transmission, the position of the internal abt pointer depends on the status of the trq bit in the last transmitted message buffer. if the trq bit is set to 1 when clearing the abttrg bit is requested, the internal abt pointer points to the la st transmitted message buffer (for details, refer to the process in figure 16-49 ). if the trq bit is cleared to 0 when clearing the abttrg bit is requested, the internal abt pointer is incremented (+1) and points to the next message buffer in the abt area (for details, refer to the process in figure 16-50 ). caution be sure to abort abt by clearing abttrg to 0. the operation is not guaranteed if aborting transmission is requested by clearing rdy bit. when the normal operation mode with abt is resumed after abt has been aborted and abttrg bit is set to 1, the next abt message buffer to be transmitted can be determined from the following table. status of trq of abt message buffer abort after successful transmission abort after erroneous transmission set (1) next message buffer in the abt area note same message buffer in the abt area cleared (0) next message buffer in the abt area note next message buffer in the abt area note note the above resumption operation can be performed only if a message buffer ready for abt exists in the abt area. for example, an abort request that is issued while abt of message buffer 7 is in progress is regarded as completion of abt, rather than abor t, if transmission of message buffer 7 has been successfully completed, even if abttrg is cleared to 0. if the rdy bit in the next message buffer in the abt area is cleared to 0, the internal abt pointer is retained, but the resumption operation is not performed even if abttrg is set to 1, and abt ends immediately. remark m = 0 to 15 16.10.5 remote frame transmission remote frames can be transmitted only from transmit mess age buffers. set whether a data frame or remote frame is transmitted via the rtr bit of the c0mconfm register. setting (1) the rtr bit sets remote frame transmission. remark m = 0 to 15
chapter 16 can controller user?s manual u19180ej1v0ud 549 16.11 power save modes 16.11.1 can sleep mode the can sleep mode can be used to set the can contro ller to standby mode in order to reduce power consumption. the can module can ente r the can sleep mode from all operation modes. release of the can sleep mode returns the can module to exactly the same oper ation mode from which the can sleep mode was entered. in the can sleep mode, the can module does not tr ansmit messages, even when transmission requests are issued or pending. (1) entering can sleep mode the cpu issues a can sleep mode transition request by writing 01b to the psmode [1:0] bits of the c0ctrl register. this transition request is only acknowle dged only under the following conditions. - the can module is already in one of the following operation modes - normal operation mode - normal operation mode with abt - receive-only mode - single-shot mode - self-test mode - can stop mode in all the above operation modes - the can bus state is bus idle (the 4th bi t in the interframe space is recessive) note - no transmission request is pending note if the can bus is fixed to dominant, the request for transition to the can sleep mode is held pending. also the transition from can stop mode to can sl eep mode is independent of the can bus state. remark if a sleep mode request is pending, and at the same time a message is received in a message box, the sleep mode request is not cancelled, but is executed right after message storage has been finished. this may result in afcan being in sleep mode, while the cpu would execute the rx interrupt routine. therefor e, the interrupt routine must check the access to the message buffers as well as reception history list register s by using the mbon flag, if sleep mode is used. if any one of the conditions mentioned above is not met, the can module will operate as follows. - if the can sleep mode is requested from the initia lization mode, the can sleep mode transition request is ignored and the can module remains in the initialization mode. - if the can bus state is not bus idle (i.e., the can bus state is either transmitting or receiving) when the can sleep mode is requested in one of the operation modes, immediate transit ion to the can sleep mode is not possible. in this case, the can sleep mode trans ition request is held pendi ng until the can bus state becomes bus idle (the 4th bit in the interframe space is recessive). in the time from the can sleep mode request to successful transition, the psmode [1:0] bi ts remain 00b. when the module has entered the can sleep mode, psmode [1:0] bits are set to 01b. - if a request for transition to the initialization mode a nd a request for transition to the can sleep are made at the same time while the can module is in one of t he operation modes, the request for the initialization mode is enabled. the can module enter s the initialization mode at a predetermined timing. at this time, the can sleep mode request is not held pending and is ignored.
chapter 16 can controller user?s manual u19180ej1v0ud 550 - even when initialization mode and sleep mode are not requested simultaneously (i.e the first request has not been granted while the second reques t is made), the request for initializ ation has priority over the sleep mode request. the sleep mode request is cancelled when the initialization mode is requested. when a pending request for initialization mode is pres ent, a subsequent request for sleep mode request is cancelled right at the point in time where it was submitted. (2) status in can sleep mode the can module is in one of the following states after it enters the can sleep mode. - the internal operating clock is stopped a nd the power consumption is minimized. - the function to detect the falling edge of the can rec eption pin (crxd) remains in effect to wake up the can module from the can bus. - to wake up the can module from the cpu, data can be written to psmode [1:0] of the can module control register (c0ctrl), but nothing can be wr itten to other can module registers or bits. - the can module registers can be read, exc ept for c0lipt, c0rgpt, c0lopt, and c0tgpt. - the can message buffer registers cannot be written or read. - mbon bit of the can global contro l register (c0gmctrl) is cleared. - a request for transition to the initializati on mode is not acknowledged and is ignored. (3) releasing can sleep mode the can sleep mode is released by the following events. - when the cpu writes 00b to the psmode [1:0] bits of the c0ctrl register - a falling edge at the can reception pin (crxd) (i.e. the can bus level shifts from recessive to dominant) cautions 1. even if the falling edge belongs to the sof of a receive message, this message will not be received and stored. if the cpu has turned off the clock to the can while the can was in sleep mode, even subsequently the can sleep mode will not be released and psmode [1:0] will continue to be 01b unless the clock to the can is supplied again. in addition to this, th e receive message will not be received after that. 2. if the falling edge on the can reception pin (crxd) is detected in the state that the can clock is supplied, it is necessary to clear the psmode0 bit by software (for details, refer to the processing in figure 16-54). after releasing the sleep mode, the can module return s to the operation mode fr om which the can sleep mode was requested and the psmode [1:0] bits of the c0ct rl register are reset to 00b. if the can sleep mode is released by a change in the ca n bus state, the cints5 bit of t he c0ints register is set to 1, regardless of the cie bit of the c0ie register. after t he can module is released from the can sleep mode, it participates in the can bus again by automatically detecting 11 consecutive recessive-level bits on the can bus. the user application has to wait until mb on = 1, before accessing message buffers again. when a request for transition to the initialization mode is made while the can module is in the can sleep mode, that request is ignored; the cpu has to be released from sleep mode by software first before entering the initialization mode. caution be aware that the release of can sleep mode by can bus event, and thus the wake up interrupt may happen at any time, even right after requesting sleep mode, if a can bus event occurs. remark m = 0 to 15
chapter 16 can controller user?s manual u19180ej1v0ud 551 16.11.2 can stop mode the can stop mode can be used to set the can controller to standby mode to reduce power consumption. the can module can enter the can stop mode only from the ca n sleep mode. release of the can stop mode puts the can module in the can sleep mode. the can stop mode can only be released (entering can sleep mode) by writing 01b to the psmode [1:0] bits of the c0ctrl register and not by a cha nge in the can bus state. no message is transmitted even when transmission requests are issued or pending. (1) entering can stop mode a can stop mode transition request is issued by writ ing 11b to the psmode [1:0] bits of the c0ctrl register. a can stop mode request is only acknowledged when the can module is in the can sleep mode. in all other modes, the request is ignored. caution to set the can module to the can stop mode, the module must be in the can sleep mode. to confirm that the module is in the sleep mode, check that psmode [1:0] = 01b, and then request the can stop mode. if a bus change occurs at the can reception pin (crxd) while this process is being performed, the can sleep mode is automatically released. in this case, the can stop mode transition request cannot be acknowledged (however, in the state that the can clock is supplied, it is necessary to clear the psmode0 bit by software after a bus change occurs at the can reception pin (crxd)). (2) status in can stop mode the can module is in one of the following states after it enters the can stop mode. - the internal operating clock is stopped a nd the power consumption is minimized. - to wake up the can module from the cpu, data can be written to psmode [1:0] of the can module control register (c0ctrl), but nothing can be wr itten to other can module registers or bits. - the can module registers can be read, exc ept for c0lipt, c0rgpt, c0lopt, and c0tgpt. - the can message buffer registers cannot be written or read. - mbon bit of the can global contro l register (c0gmctrl) is cleared. - an initialization mode transition request is not acknowledged and is ignored. (3) releasing can stop mode the can stop mode can only be released by writing 01b to the psmode [1:0] bits of the c0ctrl register. after releasing the can stop mode, the can module enters the can sleep mode. when the initialization mode is reques ted while the can module is in the can stop mode, that request is ignored; the cpu has to release the stop mode a nd subsequently can sleep mode before entering the initialization mode. it is impossi ble to enter the other operation mode directly fr om the can stop mode not entering the can sleep mode , that request is ignored. remark m = 0 to 15
chapter 16 can controller user?s manual u19180ej1v0ud 552 16.11.3 example of using power saving modes in some application systems, it may be necessary to pl ace the cpu in a power saving mode to reduce the power consumption. by using the power saving mode specific to the can module and the power saving mode specific to the cpu in combination, the cpu can be woken up fr om the power saving status by the can bus. here is an example of using the power saving modes. first, put the can module in the can sleep mode (psmode = 01b). next, put the cpu in the power saving mode. if an edge transition from recessive to dominant is dete cted at the can reception pin (crxd) in this status, the cints5 bit in the can module is set to 1. if the cie5 bi t of the c0ctrl register is set to 1, a wakeup interrupt (intc0wup) is generated. the can m odule is automatically released fr om the can sleep mode (psmode = 00b) and returns to the normal operation mode (however, in the stat e that the can clock is suppl ied, it is necessary to clear the psmode0 bit by software after a bus change is det ected at the can reception pin (crxd)). the cpu, in response to intc0wup, can release its own power saving mode and return to the normal operation mode. to further reduce the power consumpti on of the cpu, the internal clocks, in cluding that of the can module, may be stopped. in this case, the operating clock supplied to the can module is stopped afte r the can module is put in the can sleep mode. then the cpu enters a power saving m ode in which the clock supplied to the cpu is stopped. if an edge transition from recessive to dominant is detected at the can reception pin (crxd) in this status, the can module can set the cints5 bit to 1 and generate the wakeup interrupt (intc0wup) even if it is not supplied with the clock. the other functions, however, do not operate because clock supply to the can module is stopped, and the module remains in the can sleep mode. the cpu, in response to intc0wup, releases its power saving mode, resumes supply of the internal clocks, including the clock to the can module, after the oscillation stabilization time has elapsed, and starts instruction exec ution. the can module is immediatel y released from the can sleep mode when clock supply is resumed, and returns to the normal operation mode (psmode = 00b).
chapter 16 can controller user?s manual u19180ej1v0ud 553 16.12 interrupt function the can module provides 6 different interrupt sources. the occurrence of these interrupt source s is stored in interrupt status regist ers. four separate interrupt request signals are generated from the six interrupt sources. when an interrupt request signal that corresponds to two or more interrupt sources is generated, the interrupt sources can be identified by us ing an interrupt status register. after an interrupt source has occurred, the corresponding inte rrupt status bit must be cleared to 0 by software. table 16-20. list of can module interrupt sources no. interrupt status bit interrupt enable bit name register name register interrupt request signal interrupt source description 1 cints0 note 1 c0ints cie0 note 1 c0ie intc0trx message frame successfully transmitted from message buffer m 2 cints1 note 1 c0ints cie1 note 1 c0ie intc0rec valid message frame reception in message buffer m 3 cints2 c0ints cie2 c0ie can module error state interrupt note 2 4 cints3 c0ints cie3 c0ie can module protocol error interrupt note 3 5 cints4 c0ints cie4 c0ie intc0err can module arbitration loss interrupt 6 cints5 c0ints cie5 c0ie intc0wup can module wakeup interrupt from can sleep mode note 4 notes 1. the ie bit (message buffer interrupt enable bit) in t he c0mctrl register of the corresponding message buffer has to be set to 1 for t hat message buffer to participate in the interrupt generation process. 2. this interrupt is generated when the tr ansmission/reception error counter is at the warning level, or in the error passive or bus-off state. 3. this interrupt is generated when a stuff error, form error, ack error, bit e rror, or crc error occurs. 4. this interrupt is generated w hen the can module is woken up fr om the can sleep mode because a falling edge is detected at the can reception pin (can bus transition from recessive to dominant). remark m = 0 to 15
chapter 16 can controller user?s manual u19180ej1v0ud 554 16.13 diagnosis functions and special operational modes the can module provides a receive-only mode, single- shot mode, and self-test mode to support can bus diagnosis functions or the operation of specific can communication methods. 16.13.1 receive-only mode the receive-only mode is used to monitor receive mess ages without causing any interference on the can bus and can be used for can bus analysis nodes. for example, this mode can be used for automatic baud-rate detection. the baud rate in the can module is changed until "valid reception" is detec ted, so that the baud rates in the module match ("valid reception" means a message frame has been received in the can protocol laye r without occurrence of an error and with an appropriate ack between nodes connected to the can bus). a valid rec eption does not require mess age frames to be stored in a receive message buffer (data frames) or transmit message bu ffer (remote frames). the event of valid reception is indicated by setting the valid bit of the c0ctrl register (1). figure 16-33. can module terminal connection in receive-only mode can macro rx tx ctxd crxd fixed to the recessive level in the receive-only mode, no message frames can be transm itted from the can module to the can bus. transmit requests issued for message buffers defined as transmit message buffers are held pending. in the receive-only mode, the can transmission pin (ctxd) in the can module is fixed to the recessive level. therefore, no active error flag can be transmitted from t he can module to the can bus even when a can bus error is detected while receiving a message frame. since no transmission can be issued from the can module, the transmission error counter tec is never updated. therefore, a can module in the receive-only mode does not enter the bus-off state.
chapter 16 can controller user?s manual u19180ej1v0ud 555 furthermore, ack is not returned to the can bus in th is mode upon the valid reception of a message frame. internally, the local node recognizes that it has transmitted ack. an overload frame cannot be transmitted to the can bus. caution if only two can nodes are connected to the can bus and one of them is operating in the receive-only mode, there is no ack on the can bus. due to the missing ack, the transmitting node will transmit an active error flag, and repeat transmitting a message frame. the transmitting node becomes error passive after transmitting the message frame 16 times (assuming that the error counter was 0 in the beginning and no ot her errors have occurred). after the message frame for the 17th time is transmitted, the transmitting node generates a passive error flag. the receiving node in the re ceive-only mode detects the first valid message frame at this point, and the valid bi t is set to 1 for the first time. 16.13.2 single-shot mode in the single-shot mode, autom atic re-transmission as defined in the can protocol is switched off (according to the can protocol, a message frame transmission that has been aborted by either arbitration loss or error occurrence has to be repeated without control by software.). all other beha vior of single shot mode is identical to normal operation mode. features of single shot mode can not be us ed in combination with normal mode with abt. the single-shot mode disables the re-transmission of an aborted message frame transmission according to the setting of the al bit of the c0ctrl register. when the al bi t is cleared to 0, re-transmission upon arbitration loss and upon error occurrence is disabled. if the al bit is set to 1, re-transmission upon error occurrence is disabled, but re- transmission upon arbitration loss is enabled. as a cons equence, the trq bit in a message buffer defined as a transmit message buffer is cleared to 0 by the following events. - successful transmission of the message frame - arbitration loss while sending the message frame - error occurrence while sending the message frame the events arbitration loss and error occurrence can be dist inguished by checking the cints4 and cints3 bits of the c0ints register respectively, and the type of the error can be identified by reading the lec[2:0] bits of the c0lec register. upon successful transmission of the message frame, the transmit completion interrupt bit cints0 of the c0ints register is set to 1. if the cie0 bit of the c0ie register is set to 1 at this time, an in terrupt request signal is output. the single-shot mode can be used when emulating time-triggered communication methods (e.g. ttcan level 1). caution the al bit is only valid in single-shot mode. it does not influence the operation of re- transmission upon arbitration loss in the other operation modes.
chapter 16 can controller user?s manual u19180ej1v0ud 556 16.13.3 self-test mode in the self-test mode, message frame transmission and message frame reception can be tested without connecting the can node to the can bus or without affecting the can bus. in the self-test mode, the can modu le is completely disconnected from the can bus, but transmission and reception are internally looped back. the can transmi ssion pin (ctxd) is fixed to the recessive level. if the falling edge on the can reception pin (crxd) is de tected after the can module has entered the can sleep mode from the self-test mode, however, the module is released from the can sl eep mode in the same manner as the other operation modes (however, to release the can sleep mo de in the state that the can clock is supplied, it is necessary to clear the psmode0 bit by software after the falling edge on the can reception pin (crxd) is detected). to keep the module in the can sleep mode, use t he can reception pin (crxd) as a port pin. figure 16-34. can module terminal connection in self-test mode can macro rx tx ctxd crxd fixed to the recessive level
chapter 16 can controller user?s manual u19180ej1v0ud 557 16.13.4 receive/transmit operation in each operation mode table 16-21 shows outline of the receive/tr ansmit operation in each operation mode. table 16-21. outline of the receive/transmit in each operation mode operation mode transmission of data/ remote frame transmission of ack transmission of error/ overload frame transmission retry automatic block transmission (abt) set of valid bit store data to message buffer initialization mode no no no no no no no normal operation mode yes yes yes yes no yes yes normal operation mode with abt yes yes yes yes yes yes yes receive- only mode no no no no no yes yes single-shot mode yes yes yes no note 1 no yes yes self-test mode yes note 2 yes note 2 yes note 2 yes note 2 no yes note 2 yes note 2 notes 1. when the arbitration lost occurs, c ontrol of re-transmission is possible by the al bit of c0ctrl register. 2. each signals are not generated to out side, but generated into the can module.
chapter 16 can controller user?s manual u19180ej1v0ud 558 16.14 time stamp function can is an asynchronous, serial protocol. all nodes connect ed to the can bus have a local, autonomous clock. as a consequence, the clocks of the nodes have no relation (i.e., the clocks are asynchronous and may have different frequencies). in some applications, however, a common time base over the network (= global time base) is needed. in order to build up a global time base, a time stam p function is used. the essential mechan ism of a time stamp function is the capture of timer values triggered by signals on the can bus. 16.14.1 time stamp function the can controller supports the capturing of timer values triggered by a specific frame. an on-chip 16-bit capture timer unit in a microcontroller system is used in addition to the can controller. the 16-bi t capture timer unit captures the timer value according to a trigger signal (tsout) for ca pturing that is out put when a data frame is received from the can controller. the cpu can retrie ve the time of occurrence of the capt ure event, i.e., the time stamp of the message received from the can bus, by reading the capt ured value. tsout signal can be selected from the following two event sources and is specified by the tssel bit of the c0ts register. - sof event (start of frame) (tssel = 0) - eof event (last bit of end of frame) (tssel = 1) the tsout signal is enabled by setting the tsen bit of the c0ts register to 1. figure 16-35. timing diagram of capture signal tsout t tsout sof sof sof sof tsout signal toggles its level upon occurrence of the se lected event during data frame reception (in the above timing diagram, the sof is used as the trigger event source ). to capture a timer value by using tsout signal, the capture timer unit must detect the capture signal at both th e rising edge and falling edge. this time stamp function is controlled by the tslock bit of the c0ts register. when tslock is cleared to 0, tsout bit toggles upon occurrence of the selected event. if tslock bit is set to 1, tsout toggles upon occurrence of the selected event, but the toggle is stopped as the tsen bit is automatically cleared to 0 as soon as the message storing to the message buffer 0 starts. this suppresses the subsequent toggle occurrence by tsout, so that the time stamp value toggled last (= capt ured last) can be saved as the time stam p value of the time at which the data frame was received in message buffer 0.
chapter 16 can controller user?s manual u19180ej1v0ud 559 caution the time stamp function using tslock bit is to stop toggle of tsout bit by receiving a data frame in message buffer 0. therefore, message buffer 0 must be set as a receive message buffer. since a receive message buffer cannot r eceive a remote frame, toggle of tsout bit cannot be stopped by reception of a remote frame. toggle of tsout bit does not stop when a data frame is received in a message buffer other than message buffer 0. for these reasons, a data frame cannot be r eceived in message buffer 0 when the can module is in the normal operation mode with abt, because message buffer 0 must be set as a transmit message buffer. in this operation mode, therefore, the function to stop toggle of tsout bit by tslock bit cannot be used. the input source of the timer value according to a tri gger signal (tsout) can be input to the 16-bit timer/event counter 00 by port input switch control (i sc0), without connectingti000, externally. figure 16-36. port input switch control ti000 input p00/ti000 port input switch control (isc0) 0: select ti000 (p00) 1: select tsout port mode (pm00) output latch (p00) selector selector can controller remark isc0: bit 0 of the input switch control register (isc) (see figure 14-19 )
chapter 16 can controller user?s manual u19180ej1v0ud 560 16.15 baud rate settings 16.15.1 baud rate settings make sure that the settings are within the range of limit values for ensuring correct operation of the can controller, as follows. (a) 5tq spt (sampling point) 17tq spt = tseg1 + 1tq (b) 8tq dbt (data bit time) 25tq dbt = tseg1 + tseg2 + 1tq = tseg2 + spt (c) 1tq sjw (synchronization jump width) 4tq sjw dbt ? spt (d) 4tq tseg1 16tq [3 (setting value of tseg1 [3:0] 15] (e) 1tq tseg2 8tq [0 (setting value of tseg2 [2:0] 7] remark tq = 1/f tq (f tq : can protocol layer basic system clock) tseg1 [3:0]: bits 3 to 0 of can0 bit rate register (c0btr) tseg2 [2:0]: bits 10 to 8 of can0 bit rate register (c0btr) table 16-22 shows the combinations of bit rate s that satisfy the above conditions.
chapter 16 can controller user?s manual u19180ej1v0ud 561 table 16-22. settable bit rate combinations (1/3) valid bit rate setting c0btr register setting value dbt length sync segment prop segment phase segment1 phase segment2 tseg1[3:0] tseg2[2:0] sampling point (unit %) 25 1 8 8 8 1111 111 68.0 24 1 7 8 8 1110 111 66.7 24 1 9 7 7 1111 110 70.8 23 1 6 8 8 1101 111 65.2 23 1 8 7 7 1110 110 69.6 23 1 10 6 6 1111 101 73.9 22 1 5 8 8 1100 111 63.6 22 1 7 7 7 1101 110 68.2 22 1 9 6 6 1110 101 72.7 22 1 11 5 5 1111 100 77.3 21 1 4 8 8 1011 111 61.9 21 1 6 7 7 1100 110 66.7 21 1 8 6 6 1101 101 71.4 21 1 10 5 5 1110 100 76.2 21 1 12 4 4 1111 011 81.0 20 1 3 8 8 1010 111 60.0 20 1 5 7 7 1011 110 65.0 20 1 7 6 6 1100 101 70.0 20 1 9 5 5 1101 100 75.0 20 1 11 4 4 1110 011 80.0 20 1 13 3 3 1111 010 85.0 19 1 2 8 8 1001 111 57.9 19 1 4 7 7 1010 110 63.2 19 1 6 6 6 1011 101 68.4 19 1 8 5 5 1100 100 73.7 19 1 10 4 4 1101 011 78.9 19 1 12 3 3 1110 010 84.2 19 1 14 2 2 1111 001 89.5 18 1 1 8 8 1000 111 55.6 18 1 3 7 7 1001 110 61.1 18 1 5 6 6 1010 101 66.7 18 1 7 5 5 1011 100 72.2 18 1 9 4 4 1100 011 77.8 18 1 11 3 3 1101 010 83.3 18 1 13 2 2 1110 001 88.9 18 1 15 1 1 1111 000 94.4
chapter 16 can controller user?s manual u19180ej1v0ud 562 table 16-22. settable bit rate combinations (2/3) valid bit rate setting c0btr register setting value dbt length sync segment prop segment phase segment1 phase segment2 tseg1[3:0] tseg2[2:0] sampling point (unit %) 17 1 2 7 7 1000 110 58.8 17 1 4 6 6 1001 101 64.7 17 1 6 5 5 1010 100 70.6 17 1 8 4 4 1011 011 76.5 17 1 10 3 3 1100 010 82.4 17 1 12 2 2 1101 001 88.2 17 1 14 1 1 1110 000 94.1 16 1 1 7 7 0111 110 56.3 16 1 3 6 6 1000 101 62.5 16 1 5 5 5 1001 100 68.8 16 1 7 4 4 1010 011 75.0 16 1 9 3 3 1011 010 81.3 16 1 11 2 2 1100 001 87.5 16 1 13 1 1 1101 000 93.8 15 1 2 6 6 0111 101 60.0 15 1 4 5 5 1000 100 66.7 15 1 6 4 4 1001 011 73.3 15 1 8 3 3 1010 010 80.0 15 1 10 2 2 1011 001 86.7 15 1 12 1 1 1100 000 93.3 14 1 1 6 6 0110 101 57.1 14 1 3 5 5 0111 100 64.3 14 1 5 4 4 1000 011 71.4 14 1 7 3 3 1001 010 78.6 14 1 9 2 2 1010 001 85.7 14 1 11 1 1 1011 000 92.9 13 1 2 5 5 0110 100 61.5 13 1 4 4 4 0111 011 69.2 13 1 6 3 3 1000 010 76.9 13 1 8 2 2 1001 001 84.6 13 1 10 1 1 1010 000 92.3 12 1 1 5 5 0101 100 58.3 12 1 3 4 4 0110 011 66.7 12 1 5 3 3 0111 010 75.0 12 1 7 2 2 1000 001 83.3 12 1 9 1 1 1001 000 91.7
chapter 16 can controller user?s manual u19180ej1v0ud 563 table 16-22. settable bit rate combinations (3/3) valid bit rate setting c0btr register setting value dbt length sync segment prop segment phase segment1 phase segment2 tseg1[3:0] tseg2[2:0] sampling point (unit %) 11 1 2 4 4 0101 011 63.6 11 1 4 3 3 0110 010 72.7 11 1 6 2 2 0111 001 81.8 11 1 8 1 1 1000 000 90.9 10 1 1 4 4 0100 011 60.0 10 1 3 3 3 0101 010 70.0 10 1 5 2 2 0110 001 80.0 10 1 7 1 1 0111 000 90.0 9 1 2 3 3 0100 010 66.7 9 1 4 2 2 0101 001 77.8 9 1 6 1 1 0110 000 88.9 8 1 1 3 3 0011 010 62.5 8 1 3 2 2 0100 001 75.0 8 1 5 1 1 0101 000 87.5 7 note 1 2 2 2 0011 001 71.4 7 note 1 4 1 1 0100 000 85.7 6 note 1 1 2 2 0010 001 66.7 6 note 1 3 1 1 0011 000 83.3 5 note 1 2 1 1 0010 000 80.0 4 note 1 1 1 1 0001 000 75.0 note setting with a dbt value of 7 or less is valid only when the value of the c0brp re gister is other than 00h. caution the values in table 16-22 do not guarantee the operation of the network system. thoroughly check the effect on the network syst em, taking into consideration osc illation errors and delays of the can bus and can transceiver.
chapter 16 can controller user?s manual u19180ej1v0ud 564 16.15.2 representative examples of baud rate settings tables 16-23 and 16-24 show representative examples of baud rate setting. table 16-23. representative examples of baud rate settings (f canmod = 8 mhz) (1/2) valid bit rate setting (unit: kbps) c0btr register setting value set baud rate value (unit: kbps) division ratio of c0brp c0brp register set value length of dbt sync segment prop segment phase segment 1 phase segment 2 tseg1 [3:0] tseg2 [2:0] sampling point (unit: %) 1000 1 00000000 8 1 1 3 3 0011 010 62.5 1000 1 00000000 8 1 3 2 2 0100 001 75.0 1000 1 00000000 8 1 5 1 1 0101 000 87.5 500 1 00000000 16 1 1 7 7 0111 110 56.3 500 1 00000000 16 1 3 6 6 1000 101 62.5 500 1 00000000 16 1 5 5 5 1001 100 68.8 500 1 00000000 16 1 7 4 4 1010 011 75.0 500 1 00000000 16 1 9 3 3 1011 010 81.3 500 1 00000000 16 1 11 2 2 1100 001 87.5 500 1 00000000 16 1 13 1 1 1101 000 93.8 500 2 00000001 8 1 1 3 3 0011 010 62.5 500 2 00000001 8 1 3 2 2 0100 001 75.0 500 2 00000001 8 1 5 1 1 0101 000 87.5 250 2 00000001 16 1 1 7 7 0111 110 56.3 250 2 00000001 16 1 3 6 6 1000 101 62.5 250 2 00000001 16 1 5 5 5 1001 100 68.8 250 2 00000001 16 1 7 4 4 1010 011 75.0 250 2 00000001 16 1 9 3 3 1011 010 81.3 250 2 00000001 16 1 11 2 2 1100 001 87.5 250 2 00000001 16 1 13 1 1 1101 000 93.8 250 4 00000011 8 1 3 2 2 0100 001 75.0 250 4 00000011 8 1 5 1 1 0101 000 87.5 125 4 00000011 16 1 1 7 7 0111 110 56.3 125 4 00000011 16 1 3 6 6 1000 101 62.5 125 4 00000011 16 1 5 5 5 1001 100 68.8 125 4 00000011 16 1 7 4 4 1010 011 75.0 125 4 00000011 16 1 9 3 3 1011 010 81.3 125 4 00000011 16 1 11 2 2 1100 001 87.5 125 4 00000011 16 1 13 1 1 1101 000 93.8 125 8 00000111 8 1 3 2 2 0100 001 75.0 125 8 00000111 8 1 5 1 1 0101 000 87.5 caution the values in table 16-23 do not guarantee the operation of the network system. thoroughly check the effect on the network system, taking into consideration oscillati on errors and delays of the can bus and can transceiver.
chapter 16 can controller user?s manual u19180ej1v0ud 565 table 16-23. representative examples of baud rate settings (f canmod = 8 mhz) (2/2) valid bit rate setting (unit: kbps) c0btr register setting value set baud rate value (unit: kbps) division ratio of c0brp c0brp register set value length of dbt sync segment prop segment phase segment 1 phase segment 2 tseg1 [3:0] tseg2 [2:0] sampling point (unit: %) 100 4 00000011 20 1 7 6 6 1100 101 70.0 100 4 00000011 20 1 9 5 5 1101 100 75.0 100 5 00000100 16 1 7 4 4 1010 011 75.0 100 5 00000100 16 1 9 3 3 1011 010 81.3 100 8 00000111 10 1 3 3 3 0101 010 70.0 100 8 00000111 10 1 5 2 2 0110 001 80.0 100 10 00001001 8 1 3 2 2 0100 001 75.0 100 10 00001001 8 1 5 1 1 0101 000 87.5 83.3 4 00000011 24 1 7 8 8 1110 111 66.7 83.3 4 00000011 24 1 9 7 7 1111 110 70.8 83.3 6 00000101 16 1 5 5 5 1001 100 68.8 83.3 6 00000101 16 1 7 4 4 1010 011 75.0 83.3 6 00000101 16 1 9 3 3 1011 010 81.3 83.3 6 00000101 16 1 11 2 2 1100 001 87.5 83.3 8 00000111 12 1 5 3 3 0111 010 75.0 83.3 8 00000111 12 1 7 2 2 1000 001 83.3 83.3 12 00001011 8 1 3 2 2 0100 001 75.0 83.3 12 00001011 8 1 5 1 1 0101 000 87.5 33.3 10 00001001 24 1 7 8 8 1110 111 66.7 33.3 10 00001001 24 1 9 7 7 1111 110 70.8 33.3 12 00001011 20 1 7 6 6 1100 101 70.0 33.3 12 00001011 20 1 9 5 5 1101 100 75.0 33.3 15 00001110 16 1 7 4 4 1010 011 75.0 33.3 15 00001110 16 1 9 3 3 1011 010 81.3 33.3 16 00001111 15 1 6 4 4 1001 011 73.3 33.3 16 00001111 15 1 8 3 3 1010 010 80.0 33.3 20 00010011 12 1 5 3 3 0111 010 75.0 33.3 20 00010011 12 1 7 2 2 1000 001 83.3 33.3 24 00010111 10 1 3 3 3 0101 010 70.0 33.3 24 00010111 10 1 5 2 2 0110 001 80.0 33.3 30 00011101 8 1 3 2 2 0100 001 75.0 33.3 30 00011101 8 1 5 1 1 0101 000 87.5 caution the values in table 16-23 do not guarantee the operation of the network system. thoroughly check the effect on the network system, taking into consideration oscillation errors and delays of the can bus and can transceiver.
chapter 16 can controller user?s manual u19180ej1v0ud 566 table 16-24. representative examples of baud rate settings (f canmod = 16 mhz) (1/2) valid bit rate setting (unit: kbps) c0btr register setting value set baud rate value (unit: kbps) division ratio of c0brp c0brp register set value length of dbt sync segment prop segment phase segment 1 phase segment 2 tseg1 [3:0] tseg2 [2:0] sampling point (unit: %) 1000 1 00000000 16 1 1 7 7 0111 110 56.3 1000 1 00000000 16 1 3 6 6 1000 101 62.5 1000 1 00000000 16 1 5 5 5 1001 100 68.8 1000 1 00000000 16 1 7 4 4 1010 011 75.0 1000 1 00000000 16 1 9 3 3 1011 010 81.3 1000 1 00000000 16 1 11 2 2 1100 001 87.5 1000 1 00000000 16 1 13 1 1 1101 000 93.8 1000 2 00000001 8 1 3 2 2 0100 001 75.0 1000 2 00000001 8 1 5 1 1 0101 000 87.5 500 2 00000001 16 1 1 7 7 0111 110 56.3 500 2 00000001 16 1 3 6 6 1000 101 62.5 500 2 00000001 16 1 5 5 5 1001 100 68.8 500 2 00000001 16 1 7 4 4 1010 011 75.0 500 2 00000001 16 1 9 3 3 1011 010 81.3 500 2 00000001 16 1 11 2 2 1100 001 87.5 500 2 00000001 16 1 13 1 1 1101 000 93.8 500 4 00000011 8 1 3 2 2 0100 001 75.0 500 4 00000011 8 1 5 1 1 0101 000 87.5 250 4 00000011 16 1 3 6 6 1000 101 62.5 250 4 00000011 16 1 5 5 5 1001 100 68.8 250 4 00000011 16 1 7 4 4 1010 011 75.0 250 4 00000011 16 1 9 3 3 1011 010 81.3 250 4 00000011 16 1 11 2 2 1100 001 87.5 250 8 00000111 8 1 3 2 2 0100 001 75.0 250 8 00000111 8 1 5 1 1 0101 000 87.5 125 8 00000111 16 1 3 6 6 1000 101 62.5 125 8 00000111 16 1 7 4 4 1010 011 75.0 125 8 00000111 16 1 9 3 3 1011 010 81.3 125 8 00000111 16 1 11 2 2 1100 001 87.5 125 16 00001111 8 1 3 2 2 0100 001 75.0 125 16 00001111 8 1 5 1 1 0101 000 87.5 caution the values in table 16-24 do not guarantee the operation of the network system. thoroughly check the effect on the network system, taking into consideration oscillati on errors and delays of the can bus and can transceiver.
chapter 16 can controller user?s manual u19180ej1v0ud 567 table 16-24. representative examples of baud rate settings (f canmod = 16 mhz) (2/2) valid bit rate setting (unit: kbps) c0btr register setting value set baud rate value (unit: kbps) division ratio of c0brp c0brp register set value length of dbt sync segment prop segment phase segment 1 phase segment 2 tseg1 [3:0] tseg2 [2:0] sampling point (unit: %) 100 8 00000111 20 1 9 5 5 1101 100 75.0 100 8 00000111 20 1 11 4 4 1110 011 80.0 100 10 00001001 16 1 7 4 4 1010 011 75.0 100 10 00001001 16 1 9 3 3 1011 010 81.3 100 16 00001111 10 1 3 3 3 0101 010 70.0 100 16 00001111 10 1 5 2 2 0110 001 80.0 100 20 00010011 8 1 3 2 2 0100 001 75.0 83.3 8 00000111 24 1 7 8 8 1110 111 66.7 83.3 8 00000111 24 1 9 7 7 1111 110 70.8 83.3 12 00001011 16 1 7 4 4 1010 011 75.0 83.3 12 00001011 16 1 9 3 3 1011 010 81.3 83.3 12 00001011 16 1 11 2 2 1100 001 87.5 83.3 16 00001111 12 1 5 3 3 0111 010 75.0 83.3 16 00001111 12 1 7 2 2 1000 001 83.3 83.3 24 00010111 8 1 3 2 2 0100 001 75.0 83.3 24 00010111 8 1 5 1 1 0101 000 87.5 33.3 30 00011101 24 1 7 8 8 1110 111 66.7 33.3 30 00011101 24 1 9 7 7 1111 110 70.8 33.3 24 00010111 20 1 9 5 5 1101 100 75.0 33.3 24 00010111 20 1 11 4 4 1110 011 80.0 33.3 30 00011101 16 1 7 4 4 1010 011 75.0 33.3 30 00011101 16 1 9 3 3 1011 010 81.3 33.3 32 00011111 15 1 8 3 3 1010 010 80.0 33.3 32 00011111 15 1 10 2 2 1011 001 86.7 33.3 37 00100100 13 1 6 3 3 1000 010 76.9 33.3 37 00100100 13 1 8 2 2 1001 001 84.6 33.3 40 00100111 12 1 5 3 3 0111 010 75.0 33.3 40 00100111 12 1 7 2 2 1000 001 83.3 33.3 48 00101111 10 1 3 3 3 0101 010 70.0 33.3 48 00101111 10 1 5 2 2 0110 001 80.0 33.3 60 00111011 8 1 3 2 2 0100 001 75.0 33.3 60 00111011 8 1 5 1 1 0101 000 87.5 caution the values in table 16-24 do not guarantee the operation of the network system. thoroughly check the effect on the network system, taking into consideration oscillati on errors and delays of the can bus and can transceiver.
chapter 16 can controller user?s manual u19180ej1v0ud 568 16.16 operation of can controller remark m = 0 to 15 figure 16-37. initialization start set cngmcs register set cngmctrl register (set gom = 1) set cnie register set cnmask register end initialize message buffers set cnbrp register, cnbtr register set cnctrl register (set opmode) remark opmode: normal operation mode, normal operation mode with abt, receive-only mode, single- shot mode, self-test mode
chapter 16 can controller user?s manual u19180ej1v0ud 569 figure 16-38. re-initialization start set c0brp register, c0btr registe r set c0ie registe r set c0mask register set c0ctrl registe r (set opmode) end clea r opmode init mode? no yes set ccerc bit yes no initialize message buffers c0erc and c0info register clear? caution after setting the can module to the initialization mode, avoid setting the module to another operation mode immediately after. if it is necessary to immedi ately set the module to another operation mode, be sure to access registers other than the c0ctrl and c0gmctrl registers (e.g. set a message buffer). remark opmode: normal operation mode, normal operation mode with abt, receive-only mode, single- shot mode, self-test mode
chapter 16 can controller user?s manual u19180ej1v0ud 570 figure 16-39. message buffer initialization start set c0mconfm registe r end rdy = 1? no yes rdy = 0? set c0midhm register, c0midlm registe r transmit message buffer? clear c0mdatam registe r set register set registe r no no yes yes start clear rdy bit set rdy bit c0mdlcm c0mctrlm cautions 1. before a message buffer is initialized, the rdy bit must be cleared. 2. make the following settings for message buffers not used by the application. - clear the rdy, trq, and dn bits of the c0mctrlm register to 0. - clear the ma0 bit of the c0mconfm register to 0.
chapter 16 can controller user?s manual u19180ej1v0ud 571 figure 16-40 shows the processing for a receive message buffer (mt [2:0] bits of c0mconfm register = 001b to 101b). figure 16-40. message buffer redefinition start set message buffers end rdy = 1? no ye s clear rdy bit rdy = 0? rstat = 0 o r valid = 1? note 1 no clear valid bit set rdy bit ye s ye s no note 2 wait for 4 can data bits notes 1. confirm that a message is being received because rdy bit must be set after a message is completely received. 2. avoid message buffer redefinition during store operati on of message reception by waiting additional 4 can data bits.
chapter 16 can controller user?s manual u19180ej1v0ud 572 figure 16-41 shows the processing for a transmit message buffer during transmission (mt [2:0] bits of c0mconfm register = 000b). figure 16-41. message buffer re definition during transmission start end rdy = 0? no yes data frame or remote frame? set rdy bit set c0mdataxm registe r set c0mdlcm registe r clear rtr bit o f c0mconfm registe r set c0midlm and c0midhm registers set c0mdlcm registe r set rtr bit o f c0mconfm registe r set c0midlm and c0midhm registers remote frame data frame transmit abort process clear rdy bit transmit? set trq bit yes wait for 1can data bits no
chapter 16 can controller user?s manual u19180ej1v0ud 573 figure 16-42 shows the processing for a transmit message buffer (mt [2:0] bits of c0mconfm register = 000b). figure 16-42. message transmit processing start end trq = 0? no yes rdy = 0? data frame or remote frame? set rdy bit yes no set c0mdataxm registe r set c0mdlcm registe r clear rtr bit o f c0mconfm registe r set c0midlm and c0midhm registers set c0mdlcm registe r set rtr bit o f c0mconfm registe r set c0midlm and c0midhm registers remote frame data frame clear rdy bit set trq bit cautions 1. the trq bit should be set after the rdy bit is set. 2. the rdy bit and trq bit should not be set at the same time.
chapter 16 can controller user?s manual u19180ej1v0ud 574 figure 16-43 shows the processing for a transmit message buffer (mt [2:0] bits of c0mconfm register = 000b). figure 16-43. abt message transmit processing start set c0mdataxm registe r set c0mdlcm registe r clear rtr bit o f c0mconfm registe r set c0midlm and c0midhm registers end a bttrg = 0? no yes clear rdy bit rdy = 0? set rdy bit yes no set abttrg bit set all abt transmit messages? tstat = 0? yes no yes no caution the abttrg bit should be set to 1 after the tstat bit is cleared to 0. checking the tstat bit and setting the abttrg bit to 1 must be processed continuously. remark this processing (normal operati on mode with abs) can only be appli ed to message buffers 0 to 7. for message buffers other than the abt message buffers, refer to figure 16-42 .
chapter 16 can controller user?s manual u19180ej1v0ud 575 figure 16-44. transmission via interrupt (using c0lopt register) start end clear rdy bit rdy = 0? data frame or remote frame? set rdy bit yes no set c0mdataxm registe r set c0mdlcm register, clear rtr bit o f c0mconfm register. set c0midlm and c0midhm registers set c0mdlcm registe r set rtr bit o f c0mconfm register. set c0midlm and c0midhm registers set trq bit remote frame data frame transmit completion interrupt processing read c0lopt registe r cautions 1. the trq bit should be set after the rdy bit is set. 2. the rdy bit and trq bit should not be set at the same time. remark also check the mbon flag at the beginning and at the end of the interrupt routine, in order to check the access to the message buffers as well as tx history list registers, in case a pending sleep mode had been executed. if mbon is detected to be cleare d at any check, the actions and results of the processing have to be discarded and processed again, after mbon is set again. it is recommended to cancel any sleep mode requests, before processing tx interrupts.
chapter 16 can controller user?s manual u19180ej1v0ud 576 figure 16-45. transmit via interrupt (using c0tgpt register) start end tovf = 1? data frame or remote frame? set rdy bit yes no set c0mdataxm registe r set c0mdlcm registe r clear rtr bit o f c0mconfm registe r set c0midlm and c0midhm registers set c0mdlcm registe r set rtr bit o f c0mconfm registe r set c0midlm and c0midhm registers set trq bit remote frame data frame read c0tgpt register clear tovf bit clear rdy bit rdy = 0? thpm = 1? no yes no yes transmit completion interrupt processing cautions 1. the trq bit should be set after the rdy bit is set. 2. the rdy bit and trq bit should not be set at the same time. remarks 1. also check the mbon flag at the beginning and at the end of the interrupt routine, in order to check the access to the message buffers as well as tx history list registers, in case a pending sleep mode had been executed. if mbon is detect ed to be cleared at any check, the actions and results of the processing have to be discar ded and processed again, after mbon is set again. it is recommended to cancel any sleep mode r equests, before processing tx interrupts. 2. if tovf was set once, the transmit history list is inconsistent. consider to scan all configured transmit buffers for co mpleted transmissions.
chapter 16 can controller user?s manual u19180ej1v0ud 577 figure 16-46. transmission via software polling start end tovf = 1? data frame o r remote frame? set rdy bit yes no set c0mdataxm registe r set c0mdlcm registe r clear rtr bit o f c0mconfm register. set c0midlm and c0midhm registers set c0mdlcm registe r set rtr bit o f c0mconfm set c0midlm and c0midhm registers set trq bit remote frame data frame read c0tgpt registe r clear tovf bit clear rdy bit rdy = 0? thpm = 1? no ye s no ye s cints0 = 1? no clear cints0 bit ye s cautions 1. the trq bit should be set after the rdy bit is set. 2. the rdy bit and trq bit should not be set at the same time. remarks 1 . also check the mbon flag at the beginning and at the end of the polling routine, in order to check the access to the message buffers as well as tx history list registers, in case a pending sleep mode had been executed. if mbon is detected to be cleared at any check, the actions and results of the processing have to be discarded and processed again, after mbon is set again. 2. if tovf was set once, the transmit history list is inconsistent. consider to scan all configured transmit buffers for co mpleted transmissions.
chapter 16 can controller user?s manual u19180ej1v0ud 578 figure 16-47. transmission abort processing (except normal operation mode with abt) start read c0lopt registe r end no yes clear trq bit tstat = 0? message buffer to be aborted matches c0lopt register? no wait for 11 can data bits transmission successful transmit abort request was successful yes note note there is a possibility of starting the transmission without being aborted even if trq bit is cleared, because the transmission request to protocol la yer might already been accepted between 11 bits, total of interframe space (3 bits ) and suspend transmission (8 bits). cautions 1. execute transmission request abort processing by clearing the trq bit, not the rdy bit. 2. before making a sleep mode transition re quest, confirm that there is no transmission request left using this processing. 3. the tstat bit can be periodically checked by a user application or can be checked after the transmit completion interrupt. 4. do not execute the new transmission requ est including in the other message buffers while transmission abort processing is in progress. 5. there is a possibility that contradict ion is caused in the judgment whether the transmission abort request was successful when the transmission from the same message buffer is consecutive or only one message buffer is used. in that case, judge it by using the history information etc. that the c0tgpt register indicates.
chapter 16 can controller user?s manual u19180ej1v0ud 579 figure 16-48. transmission abort pr ocessing except for abt transmission (normal operation mode with abt) start read c0lopt register end no yes clear trq bit tstat = 0? message buffer to be aborted matches c0lopt register? no wait for 11 can data bits transmission successful transmit abort request was successful yes no a bttrg = 0? clear abttrg bit yes transmission successful transmit abort request was successful note note there is a possibility of starting the transmission without being aborted even if trq bit is cleared, because the transmission request to protocol la yer might already been accepted between 11 bits, total of interframe space (3 bits ) and suspend transmission (8 bits). cautions 1. execute transmission request abort processing by clearing the trq bit, not the rdy bit. 2. before making a sleep mode transition re quest, confirm that there is no transmission request left using this processing. 3. the tstat bit can be periodically checked by a user application or can be checked after the transmit completion interrupt. 4. do not execute the new transmission requ est including in the other message buffers while transmission abort processing is in progress.
chapter 16 can controller user?s manual u19180ej1v0ud 580 cautions 5 there is a possibility that contradi ction is caused in the judgment whether the transmission abort request was successful when the transmission from the same message buffer is consecutive or only one message buffer is used. in that case, judge it by using the history information etc. that the cntgpt register indicates.
chapter 16 can controller user?s manual u19180ej1v0ud 581 figure 16-49 shows the processing not to skip resumpti on of transmitting a message that was stopped when transmission of an abt message buffer was aborted. figure 16-49. abt transmission abort processing (normal operation mode with abt) start end no clear abttrg bit abttrg = 0? transmission start no clear trq bit of message buffer whose transmission was aborted transmit abort yes set abtclr bit yes no tstat = 0? yes cautions 1. do not set any transmission request s while abt transmission abort processing is in progress. 2. make a can sleep mode/can stop mode transition request after abttrg bit is cleared (after abt mode is aborted) following the procedure shown in figure 16-49 or 16-50. when clearing a transmission request in an area other than the abt area, follow the procedure shown in figure 16-47.
chapter 16 can controller user?s manual u19180ej1v0ud 582 figure 16-50 shows the processing to skip resumption of transmitting a message that was stopped when transmission of an abt message buffer was aborted. figure 16-50. abt transmission request abort pr ocessing (normal operation mode with abt) start end no clear abttrg bit a bttrg = 0? transmission start pointer clear? no transmit abort yes set abtclr bit yes clear trq bit of message buffer undergoing transmission cautions 1. do not set any transmission request s while abt transmission abort processing is in progress. 2. make a can sleep mode/can stop mode request after abttrg is cleared (after abt mode is stopped) following the procedure shown in figure 16-49 or 16-50. when clearing a transmission request in an area other than the abt area, follow the procedure shown in figure 16-47.
chapter 16 can controller user?s manual u19180ej1v0ud 583 figure 16-51. reception via interrupt (using c0lipt register) start no read c0mdataxm , c0mdlcm , c0midlm, and c0midhm registers dn = 0 a nd muc = 0 read c0lipt registe r yes generation of receive completion interrupt clear dn bit note end , , note check the muc and dn bits using one read access. remark also check the mbon flag at the beginning and at t he end of the interrupt rout ine, in order to check the access to the message buffers as well as recept ion history list registers, in case a pending sleep mode had been executed. if mbon is detected to be cleared at any check, the actions and results of the processing have to be discarded and pr ocessed again, after mbon is set again. it is recommended to cancel any sleep mode r equests, before processing rx interrupts.
chapter 16 can controller user?s manual u19180ej1v0ud 584 figure 16-52. reception via interrupt (using c0rgpt register) no start clear rovf bit no rovf = 1? read c0rgpt registe r yes generation of receive completion interrupt clear dn bit dn = 0 a nd muc = 0 note rhpm = 1? end yes no yes read c0mdataxm , c0mdlcm , c0midlm, c0midhm registers , , , correct data is read illegal data is read note check the muc and dn bits using one read access. remarks 1. also check the mbon flag at the beginning and at the end of the interrupt routine, in order to check the access to the message buffers as well as reception history list registers, in case a pending sleep mode had been executed. if mbon is detected to be clear ed at any check, the actions and results of the processing have to be discarded and processed again, after mbon is set again. it is recommended to cancel any sleep mode r equests, before processing rx interrupts. 2. if rovf was set once, the receive history list is inconsistent. consider to scan all configured receive buffers for receptions.
chapter 16 can controller user?s manual u19180ej1v0ud 585 figure 16-53. reception via software polling start cints1 = 1? yes no clear rovf bit no rovf = 1? read c0rgpt registe r ye s clear dn bit dn = 0 a nd muc = 0 note rhpm = 1? end ye s no yes no read c0mdataxm , c0mdlcm , c0midlm, c0midhm registers , , , correct data is read illegal data is read clear cints1 bit note check the muc and dn bits using one read access. remarks 1. also check the mbon flag at the beginning and at the end of the polling routine, in order to check the access to the message buffers as well as reception history list registers, in case a pending sleep mode had been executed. if mbon is detected to be cleared at any check, the actions and results of the processing have to be discarded and processed again, after mbon is set again. 2. if rovf was set once, the receive history list is inconsistent. consider to scan all configured receive buffers for receptions.
chapter 16 can controller user?s manual u19180ej1v0ud 586 figure 16-54. setting can sleep mode/stop mode start (when psmode[1:0] = 00b) psmode0 = 1? set psmode0 bit can sleep mode can sleep mode end ye s no set psmode1 bit psmode1 = 1? can stop mode can stop mode request can sleep mode again? ye s no ye s no init mode? ye s no clear cints5 bit clear opmode a ccess to registers other than the c0ctrl and c0gmctrl registers set c0ctrl registe r (set opmode) caution to abort transmission before making a requ est for the can sleep mode, perform processing according to figures 16-47 to 16-50.
chapter 16 can controller user?s manual u19180ej1v0ud 587 figure 16-55. clear can sleep/stop mode start can sleep mode end clear psmode1 bit clear psmode0 bit releasing can sleep mode by user (in case can clock is disabled) releasing can sleep mode by can bus active clear cints5 bit can stop mode a fter dominant edge detection psmode0 = 0 cints5 = 1 clear cints5 bit clear psmode0 bit (in case can clock is active) releasing can sleep mode by can bus active a fter dominant edge detection psmode0 = 0/1 cints5 = 1 remark ?in case can clock is disabled?: by means of th e cpu standby mode, the can module clock has been switched off, and the can m odule is in sleep mode.
chapter 16 can controller user?s manual u19180ej1v0ud 588 figure 16-56. bus-off recovery (expect normal operation mode with abt) start a ccess to registers other than c0ctrl and c0gmctrl registers set c0ctrl registe r (clear opmode) forced recovery from bus off? end boff = 1? yes no set ccerc bit set c0ctrl registe r (set opmode) wait for recovery from bus off set c0ctrl registe r (set opmode) ye s no clear all trq bits note note clear all trq bits when re-initialization of message buffer is executed by clearing rdy bit before bus-off recovery sequence is started. caution when the transmission from the initializat ion mode to any operation modes is requested to execute bus-off recovery sequence again in the bus-off recovery sequence, reception error counter is cleared. therefore it is necessary to detect 11 consecutive recessive-level bits 128 times on the bus again. remark opmode: normal operation mode, normal operation mo de with abt, receive-only mode, single-shot mode, self-test mode
chapter 16 can controller user?s manual u19180ej1v0ud 589 figure 16-57. bus-off recovery (normal operation mode with abt) start a ccess to registers other than c0ctrl and c0gmctrl registers set c0ctrl registe r (clear opmode) forced recovery from bus off? end boff = 1? yes no set ccerc bit set c0ctrl registe r (set opmode) wait for recovery from bus off set c0ctrl registe r (set opmode) ye s no clear all trq bits clear abttrg bit note note clear all trq bits when re-initialization of message buffer is executed by clearing rdy bit before bus-off recovery sequence is started. caution when the transmission from the initializat ion mode to any operation modes is requested to execute bus-off recovery sequence again in the bus-off recovery sequence, reception error counter is cleared. therefore it is necessary to detect 11 consecutive recessive-level bits 128 times on the bus again. remark opmode: normal operation mode, normal operation mo de with abt, receive-only mode, single-shot mode, self-test mode
chapter 16 can controller user?s manual u19180ej1v0ud 590 figure 16-58. normal shutdown process start end clear gom bit init mode shutdown successful gom = 0, efsd = 0
chapter 16 can controller user?s manual u19180ej1v0ud 591 figure 16-59. forced shutdown process start gom = 0? clear gom bit end yes no shutdown successful gom = 0, efsd = 0 set efsd bit must be a subseguent write caution do not read- or write-access any registers by software between setting the efsd bit and clearing the gom bit.
chapter 16 can controller user?s manual u19180ej1v0ud 592 figure 16-60. error handling start clear cints2 bit cints2 = 1? cints3 = 1? end yes check can protocol error state (read c0lec register) no yes no error interrupt check can module state (read c0info register) cints4 = 1? no yes clear cints3 bit clear cints4 bit
chapter 16 can controller user?s manual u19180ej1v0ud 593 figure 16-61. setting cpu standby (from can sleep mode) start psmode0 = 1? ye s no can sleep mode set psmode0 bit no ye s set cpu standby mode end mbon bit = 0? clear cints5 bit clear psmode0 bit no ye s cints5 bit = 1? caution before the cpu is set in the cpu standby mode, please check the ca n sleep mode or not. however, after check of the can sleep mode, until the cpu is set in the cpu standby mode, the can sleep mode may be cancelled by wakeup from can bus.
chapter 16 can controller user?s manual u19180ej1v0ud 594 figure 16-62. setting cpu standby (from can stop mode) clear psmode0 bit set cpu standby mode start psmode0 = 1? ye s no can sleep mode set psmode0 bit set psmode1 bit psmode1 = 1? ye s no end can stop mode ye s no mbon bit = 0? clear cints5 bit note note during wakeup interrupts caution the can stop mode can only be released by writing 01b to the psmode[1:0] bit of the c0ctrl register and not by a change in the can bus state.
user?s manual u19180ej1v0ud 595 chapter 17 interrupt functions 78k0/fc2 ( pd78f088ya, 78f089za) 78k0/fe2 ( pd78f088ya, 78f0890a) 78k0/ff2 ( pd78f089ya) y = 1 to 6, z = 4, 5 y = 7 to 9 y = 1 to 3 external 8 maskable interrupts internal 22 27 17.1 interrupt function types the following two types of interrupt functions are used. (1) maskable interrupts these interrupts undergo mask control. maskable interrupts can be divided into a high interrupt priority group and a low interrupt priority group by setting the priority specification flag registers (pr0l, pr0h, pr1l, pr1h). multiple interrupt servicing can be appl ied to low-priority interrupts when hi gh-priority interrupts are generated. if two or more interrupt requests, each having the same prio rity, are simultaneously generat ed, then they are processed according to the priority of vectored interrupt servicing. for the priority order, see table 17-1 . a standby release signal is generated a nd stop and halt modes are released. external interrupt requests and internal interrupt requests are provided as maskable interrupts. (2) software interrupt this is a vectored interrupt generated by executing the brk instruction. it is acknowledged even when interrupts are disabled. the software interrupt does not undergo interrupt priority control. 17.2 interrupt sources and configuration the interrupt sources consist of maskable interrupts and softw are interrupts. in addition, they also have up to four reset sources (see table 17-1 ).
chapter 17 interrupt functions user?s manual u19180ej1v0ud 596 table 17-1. interrupt source list (1/2) interrupt source interrupt type internal/ external basic configuration type note 2 default priority note 1 name trigger vector table address f c 2 f e 2 f f 2 internal (a) 0 intlvi low-voltage detection note 3 0004h external (b) 1 intp0 0006h 2 intp1 pin input edge detection 0008h intp2 pin input edge detection internal (a) 3 inttm002 match between tm02 and cr002 (when compare register is specified), ti012 pin valid edge detection (when capture register is specified) 000ah ? external (b) intp3 pin input edge detection internal (a) 4 inttm012 match between tm02 and cr012 (when compare register is specified), ti002 pin valid edge detection (when capture register is specified) 000ch ? external (b) intp4 pin input edge detection internal (a) 5 inttm003 match between tm03 and cr003 (when compare register is specified), ti013 pin valid edge detection (when capture register is specified) 000eh ? external (b) intp5 pin input edge detection internal (a) 6 inttm013 match between tm03 and cr013 (when compare register is specified), ti003 pin valid edge detection (when capture register is specified) 0010h ? 7 intc0err afcan0 error occurrence 0012h 8 intc0wup afcan0 wakeup 0014h 9 intc0rec afcan0 reception completion 0016h 10 intc0trx afcan0 transmission completion 0018h 11 intsre60 uart60 reception error generation 001ah 12 intsr60 end of uart60 reception 001ch 13 intst60 end of uart60 transmission 001eh intcsi10 end of csi10 transmission 14 intsre61 uart61 reception error generation 0020h external (b) intp6 pin input edge detection internal (a) 15 intsr61 end of uart61 reception 0022h external (b) intp7 pin input edge detection maskable internal (a) 16 intst61 end of uart61 transmission 0024h notes 1. the default priority is the priority applicable when two or more maskable interrupt are generated simultaneously. 0 is the highest priority, and 28 is the lowest. 2. basic configuration types (a) to (c) co rrespond to (a) to (c) in figure 17-1. 3. when bit 1 (lvimd) of the low-voltage detection register (lvim) is set to 0.
chapter 17 interrupt functions user?s manual u19180ej1v0ud 597 table 17-1. interrupt source list (2/2) interrupt source interrupt type internal/ external basic configuration type note 2 default priority note 1 name trigger vector table address f c 2 f e 2 f f 2 internal (a) 17 inttmh1 match between tmh1 and cmp01 (when compare register is specified) 0026h 18 inttmh0 match between tmh0 and cmp00 (when compare register is specified) 0028h 19 inttm50 match between tm50 and cr50 (when compare register is specified) 002ah 20 inttm000 match between tm00 and cr000 (when compare register is specified), ti010 pin valid edge detection (when capture register is specified) 002ch 21 inttm010 match between tm00 and cr010 (when compare register is specified), ti000 pin valid edge detection (when capture register is specified) 002eh 22 intad end of a/d conversion 0030h 23 intwti watch timer reference time interval signal intdmu dmu operation end 0032h 24 inttm51 note 3 match between tm51 and cr51 (when compare register is specified) 0034h 25 intwt watch timer overflow 0036h 26 intcsi11 end of csi11 communication 0038h ? 27 inttm001 match between tm01 and cr001 (when compare register is specified), ti011 pin valid edge detection (when capture register is specified) 003ah maskable 28 inttm011 match between tm01 and cr011 (when compare register is specified), ti001 pin valid edge detection (when capture register is specified) 003ch software ? (c) ? brk brk instruction execution 003eh ? ? reset reset input poc power-on clear lvi low-voltage detection note 4 reset ? wdt wdt overflow 0000h notes 1. the default priority is the priority applicable when two or more maskable interrupt are generated simultaneously. 0 is the highest priority, and 28 is the lowest. 2. basic configuration types (a) to (c) co rrespond to (a) to (c) in figure 17-1. 3. when the 8-bit timer/event counter 51 is used in t he carrier generator mode, the interrupt source is inttm5h1 (see figure 9-13 transfer timing). 4. when bit 1 (lvimd) of the low-voltage det ection register (lvim) is set to 1.
chapter 17 interrupt functions user?s manual u19180ej1v0ud 598 figure 17-1. basic configuration of interrupt function (a) internal maskable interrupt internal bus interrupt request if mk ie pr isp priority controller vector table address generator standby release signal (b) external maskable inte rrupt (intp0 to intp7) internal bus interrupt request if mk ie pr isp priority controller vector table address generator standby release signal external interrupt edge enable register (egp, egn) edge detector (c) software interrupt internal bus interrupt request priority controller vector table address generator if: interrupt request flag ie: interrupt enable flag isp: in-service priority flag mk: interrupt mask flag pr: priority specification flag
chapter 17 interrupt functions user?s manual u19180ej1v0ud 599 17.3 registers controlling interrupt functions the following 6 types of registers are us ed to control the interrupt functions. ? interrupt request flag register (if0l, if0h, if1l, if1h) ? interrupt mask flag register (mk0l, mk0h, mk1l, mk1h) ? priority specification flag register (pr0l, pr0h, pr1l, pr1h) ? external interrupt rising edge enable register (egp) ? external interrupt falling edge enable register (egn) ? program status word (psw) table 17-2 shows a list of interrupt request flags, interrupt mask flags, and priority specification flags corresponding to interrupt request sources.
chapter 17 interrupt functions user?s manual u19180ej1v0ud 600 table 17-2. flags corresponding to interrupt request sources interrupt request flag interrupt mask flag priority specification flag f c 2 f e 2 f f 2 interrupt request register register register intlvi lviif if0l lvimk mk0l lvipr pr0l intp0 pif0 pmk0 ppr0 intp1 pif1 pmk1 ppr1 intp2 pif2 pmk2 ppr2 ? inttm002 tmif002 dualif3 note 1 tmmk002 dualmk3 note 2 tmpr002 dualpr3 note 2 intp3 pif3 pmk3 ppr3 ? inttm012 tmif012 dualif4 note 1 tmmk012 dualmk4 note 2 tmpr012 dualpr4 note 2 intp4 pif4 pmk4 ppr4 ? inttm003 tmif003 dualif5 note 1 tmmk003 dualmk5 note 2 tmpr003 dualpr5 note 2 intp5 pif5 pmk5 ppr5 ? inttm013 tmif013 dualif6 note 1 tmmk013 dualmk6 note 2 tmpr013 dualpr6 note 2 intc0err c0errif c0errmk c0errpr intc0wup c0wupif if0h c0wupmk mk0h c0wuppr pr0h intc0rec c0recif c0recmk c0recpr intc0trx c0trxif c0trxmk c0trxpr intsre60 sreif60 sremk60 srepr60 intsr60 srif60 srmk60 srpr60 intst60 stif60 stmk60 stpr60 intcsi10 csiif10 csimk10 csipr10 intsre61 sreif61 dualif0 note 1 sremk61 dualmk0 note 2 srepr61 dualpr0 note 2 intp6 pif6 pmk6 ppr6 intsr61 srif61 dualif1 note 1 srmk61 dualmk1 note 2 srpr61 dualpr1 note 2 intp7 pif7 if1l pmk7 mk1l ppr7 pr1l intst61 stif61 dualif2 note 1 stmk61 dualmk2 note 2 stpr61 dualpr2 note 2 inttmh1 tmifh1 tmmkh1 tmprh1 inttmh0 tmifh0 tmmkh0 tmprh0 inttm50 tmif50 tmmk50 tmpr50 inttm000 tmif000 tmmk000 tmpr000 inttm010 tmif010 tmmk010 tmpr010 intad adif admk adpr intwti wtiif wtimk wtipr intdmu dmuif dualif7 note 1 dmumk dualmk7 note 2 dmupr dualpr7 note 2 inttm51 note 3 tmif51 if1h tmmk51 mk1h tmpr51 pr1h intwt wtif wtmk wtpr ? intcsi11 csiif11 csimk11 csipr11 inttm001 tmif001 tmmk001 tmpr001 inttm011 tmif011 tmmk011 tmpr011 notes 1. if either of the two types of interrupt s ources is generated, these flags are set (1). 2. both types of interrupt sources are supported. 3. when the 8-bit timer/event counter 51 is used in the carrier generator mode, the interrupt source is inttm5h1 (see figure 9-13 transfer timing).
chapter 17 interrupt functions user?s manual u19180ej1v0ud 601 (1) interrupt request flag registers (if0l, if0h, if1l, if1h) the interrupt request flags are set to 1 when the correspo nding interrupt request is g enerated or an instruction is executed. they are cleared to 0 when an instruction is executed upon acknowledgment of an interrupt request or upon reset signal generation. when an interrupt is acknowledged, the interrupt req uest flag is automatically cleared and then the interrupt routine is entered. if0l, if0h, if1l, and if1h are set by a 1-bit or 8-bit memory manipulation instruction. when if0l and if0h, and if1l and if1h are combined to form 16-bit registers if0 and if1, they are read with a 16-bit memory manipulation instruction. reset signal generation clears these registers to 00h. cautions 1. when operating a timer, serial interface, or a/d converter after standby release, operate it once after clearing the interrupt request flag. an interrupt request flag may be set by noise. 2. when manipulating a flag of the interrupt request flag register, use a 1-bit memory manipulation instruction (clr1). when descr ibing in c language, u se a bit manipulation instruction such as ?if0l.0 = 0;? or ?_asm(?clr1 if0l, 0?);? because the compiled assembler must be a 1-bit memory manipulation instruction (clr1). if a program is described in c language using an 8-bit memory manipulation instruction such as ?if0l &= 0xfe;? and compiled, it becomes the assembler of three instructions. mov a, if0l and a, #0feh mov if0l, a in this case, even if the request flag of anot her bit of the same interrupt request flag register (if0l) is set to 1 at the timing between ?mov a, if0l? and ?mov if0l, a?, the flag is cleared to 0 at ?mov if0l, a?. therefore, care mu st be exercised when using an 8-bit memory manipulation instruction in c language.
chapter 17 interrupt functions user?s manual u19180ej1v0ud 602 figure 17-2. format of interrupt request flag registers (if0l, if0h, if1l, if1h) (78k0/fc2) address: ffe0h after reset: 00h r/w symbol <7> <6> <5> <4> <3> <2> <1> <0> if0l c0errif pif5 pif4 pif3 pif2 pif1 pif0 lviif address: ffe1h after reset: 00h r/w symbol <7> <6> <5> <4> <3> <2> <1> <0> if0h dualif1 pif6 srif61 durlif0 csiif10 sreif61 stif60 srif60 sreif60 c0trxif c0recif c0wupif address: ffe2h after reset: 00h r/w symbol <7> <6> <5> <4> <3> <2> <1> <0> if1l dualif7 wtiif dmuif adif tmif010 tmif000 tmif50 tmifh0 tmifh1 dualif2 pif7 stif61 address: ffe3h after reset: 00h r/w symbol 7 6 5 <4> <3> 2 <1> <0> if1h 0 0 0 tmif011 tmif 001 0 wtif tmif51 xxifx interrupt request flag 0 no interrupt request signal is generated 1 interrupt request is generated, interrupt request status caution be sure to set bits 2, 5 to 7 of if1h to 0.
chapter 17 interrupt functions user?s manual u19180ej1v0ud 603 figure 17-3. format of interrupt request flag regi sters (if0l, if0h, if1l, if1h) (78k0/fe2, 78k0/ff2) address: ffe0h after reset: 00h r/w symbol <7> <6> <5> <4> <3> <2> <1> <0> if0l c0errif dualif6 pif5 tmif013 dualif5 pif4 tmif003 dualif4 pif3 tmif012 dualif3 pif2 tmif002 pif1 pif0 lviif address: ffe1h after reset: 00h r/w symbol <7> <6> <5> <4> <3> <2> <1> <0> if0h dualif1 pif6 srif61 durlif0 csiif10 sreif61 stif60 srif60 sreif60 c0trxif c0recif c0wupif address: ffe2h after reset: 00h r/w symbol <7> <6> <5> <4> <3> <2> <1> <0> if1l dualif7 wtiif dmuif adif tmif010 tmif000 tmif50 tmifh0 tmifh1 dualif2 pif7 stif61 address: ffe3h after reset: 00h r/w symbol 7 6 5 <4> <3> <2> <1> <0> if1h 0 0 0 tmif011 tmif 001 csiif11 wtif tmif51 xxifx interrupt request flag 0 no interrupt request signal is generated 1 interrupt request is generated, interrupt request status caution be sure to set bits 5 to 7 of if1h to 0.
chapter 17 interrupt functions user?s manual u19180ej1v0ud 604 (2) interrupt mask flag registers (mk0l, mk0h, mk1l, mk1h) the interrupt mask flags are used to enable/disable the corresponding maskable interrupt servicing. mk0l, mk0h, mk1l, and mk1h are set by a 1-bit or 8- bit memory manipulation instruction. when mk0l and mk0h, and mk1l and mk1h are combined to form 16-bit registers mk0 and mk1, they are set with a 16-bit memory manipulation instruction. reset signal generation sets these registers to ffh. figure 17-4. format of interrupt mask flag registers (mk0l, mk0h, mk1l, mk1h) (78k0/fc2) address: ffe4h after reset: ffh r/w symbol <7> <6> <5> <4> <3> <2> <1> <0> mk0l c0errmk pmk5 pmk4 pmk3 pmk2 pmk1 pmk0 lvimk address: ffe5h after reset: ffh r/w symbol <7> <6> <5> <4> <3> <2> <1> <0> mk0h dualmk1 pmk6 srmk61 durlmk0 csimk10 sremk61 stmk60 srmk60 sremk60 c0trxmk c0recmk c0wupmk address: ffe6h after reset: ffh r/w symbol <7> <6> <5> <4> <3> <2> <1> <0> mk1l dualmk7 wtimk dmumk admk tmmk010 tmmk000 tmmk50 tmmkh0 tmmkh1 dualmk2 pmk7 stmk61 address: ffe7h after reset: ffh r/w symbol 7 6 5 <4> <3> 2 <1> <0> mk1h 1 1 1 tmmk011 tmmk001 1 wtmk tmmk51 xxmkx interrupt servicing control 0 interrupt servicing enabled 1 interrupt servicing disabled caution be sure to set bits 2, 5 to 7 of mk1h to 1.
chapter 17 interrupt functions user?s manual u19180ej1v0ud 605 figure 17-5. format of interrupt mask flag registers (mk0l, mk0h, mk1l, mk1h) (78k0/fe2, 78k0/ff2) address: ffe4h after reset: ffh r/w symbol <7> <6> <5> <4> <3> <2> <1> <0> mk0l c0errmk dualmk6 pmk5 tmmk013 dualmk5 pmk4 tmmk003 dualmk4 pmk3 tmmk012 dualmk3 pmk2 tmmk002 pmk1 pmk0 lvimk address: ffe5h after reset: ffh r/w symbol <7> <6> <5> <4> <3> <2> <1> <0> mk0h dualmk1 pmk6 srmk61 durlmk0 csimk10 sremk61 stmk60 srmk60 sremk60 c0trxmk c0recmk c0wupmk address: ffe6h after reset: ffh r/w symbol <7> <6> <5> <4> <3> <2> <1> <0> mk1l dualmk7 wtimk dmumk admk tmmk010 tmmk000 tmmk50 tmmkh0 tmmkh1 dualmk2 pmk7 stmk61 address: ffe7h after reset: ffh r/w symbol 7 6 5 <4> <3> <2> <1> <0> mk1h 1 1 1 tmmk011 tmmk 001 csimk11 wtmk tmmk51 xxmkx interrupt servicing control 0 interrupt servicing enabled 1 interrupt servicing disabled caution be sure to set bits 5 to 7 of mk1h to 1.
chapter 17 interrupt functions user?s manual u19180ej1v0ud 606 (3) priority specification flag re gisters (pr0l, pr0h, pr1l, pr1h) the priority specification flag registers are used to se t the corresponding maskable interrupt priority order. pr0l, pr0h, pr1l, and pr1h are set by a 1-bit or 8-bi t memory manipulation instruction. if pr0l and pr0h, and pr1l and pr1h are combined to form 16-bit registers pr0 and pr1, they are set with a 16-bit memory manipulation instruction. reset signal generation sets these registers to ffh. figure 17-6. format of priority specification flag registers (pr0l, pr0h, pr1l, pr1h) (78k0/fc2) address: ffe8h after reset: ffh r/w symbol <7> <6> <5> <4> <3> <2> <1> <0> pr0l c0errpr ppr5 ppr4 ppr3 ppr2 ppr1 ppr0 lvipr address: ffe9h after reset: ffh r/w symbol <7> <6> <5> <4> <3> <2> <1> <0> pr0h dualpr1 ppr6 srpr61 durlpr0 csipr10 srepr61 stpr60 srpr60 srepr60 c0trxpr c0recpr c0wuppr address: ffeah after reset: ffh r/w symbol <7> <6> <5> <4> <3> <2> <1> <0> pr1l dualpr7 wtipr dmupr adpr tmpr010 tmpr000 tmpr50 tmprh0 tmprh1 dualpr2 ppr7 stpr61 address: ffebh after reset: ffh r/w symbol 7 6 5 <4> <3> 2 <1> <0> pr1h 1 1 1 tmpr011 tmpr 001 1 wtpr tmpr51 xxprx priority level selection 0 high priority level 1 low priority level caution be sure to set bit 2, 5 to 7 of pr1h to 1.
chapter 17 interrupt functions user?s manual u19180ej1v0ud 607 figure 17-7. format of priority specification flag re gisters (pr0l, pr0h, pr1l, pr1h) (78k0/fe2, 78k0/ff2) address: ffe8h after reset: ffh r/w symbol <7> <6> <5> <4> <3> <2> <1> <0> pr0l c0errpr dualpr6 ppr5 tmpr073 dualpr5 ppr4 tmpr003 dualpr4 ppr3 tmpr012 dualpr3 ppr2 tmpr002 ppr1 ppr0 lvipr address: ffe9h after reset: ffh r/w symbol <7> <6> <5> <4> <3> <2> <1> <0> pr0h dualpr1 ppr6 srpr61 durlpr0 csipr10 srepr61 stpr60 srpr60 srepr60 c0trxpr c0recpr c0wuppr address: ffeah after reset: ffh r/w symbol <7> <6> <5> <4> <3> <2> <1> <0> pr1l dualpr7 wtipr dmupr adpr tmpr010 tmpr000 tmpr50 tmprh0 tmprh1 dualpr2 ppr7 stpr61 address: ffebh after reset: ffh r/w symbol 7 6 5 <4> <3> <2> <1> <0> pr1h 1 1 1 tmpr011 tmpr 001 csipr11 wtpr tmpr51 xxprx priority level selection 0 high priority level 1 low priority level caution be sure to set bit 5 to 7 of pr1h to 1.
chapter 17 interrupt functions user?s manual u19180ej1v0ud 608 (4) external interrupt rising edge en able register (egp), external interrupt falling edge enable register (egn) these registers specify the valid edge for intp0 to intp7. egp and egn are set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears these registers to 00h. figure 17-8. format of external interrupt rising edge enable register (egp) and external interrupt falling edge enable register (egn) address: ff48h after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 egp egp7 epg6 egp5 egp4 egp3 egp2 egp1 egp0 address: ff49h after reset: 00h r/w symbol 7 6 5 4 3 2 1 0 egn egn7 egn6 egn5 egn4 egn3 egn2 egn1 egn0 egpn egnn intpn pin valid edge selection (n = 0 to 7) 0 0 edge detection disabled 0 1 falling edge 1 0 rising edge 1 1 both rising and falling edges table 17-3 shows the ports corresponding to egpn and egnn. table 17-3. ports corresponding to egpn and egnn detection enable register edge dete ction port external request signal egp0 egn0 p120 intp0 egp1 egn1 p30 intp1 egp2 egn2 p31 intp2 egp3 egn3 p32 intp3 egp4 egn4 p33 intp4 egp5 egn5 p16 intp5 egp6 egn6 p72 intp6 egp7 egn7 p73 intp7 caution select the port mode by clearing egpn and egnn to 0 because an edge may be detected when the external interrupt function is switched to the port function. remark n = 0 to 7
chapter 17 interrupt functions user?s manual u19180ej1v0ud 609 (5) program status word (psw) the program status word is a register used to hold the instruction executi on result and the current status for an interrupt request. the ie flag that sets maskable interr upt enable/disable and the isp fl ag that controls multiple interrupt servicing are mapped to the psw. besides 8-bit read/write, this register can carry out op erations using bit manipulation instructions and dedicated instructions (ei and di). when a vect ored interrupt request is acknowledged, if the brk instruction is executed, the contents of the psw are aut omatically saved into a stack and the ie flag is reset to 0. if a maskable interrupt request is acknowledged, the contents of the priority specification flag of the acknowledged interrupt are transferred to the isp flag. the psw contents are also saved into the stack with the push psw instruction. they are restored from the stack with the reti, retb, and pop psw instructions. reset signal generation sets psw to 02h. figure 17-9. format of program status word <7> ie <6> z <5> rbs1 <4> ac <3> rbs0 2 0 <1> isp 0 cy psw after reset 02h isp high-priority interrupt servicing (low-priority interrupt disabled) ie 0 1 disabled priority of interrupt currently being serviced interrupt request acknowledgment enable/disable used when normal instruction is executed enabled interrupt request not acknowledged, or low- priority interrupt servicing (all maskable interrupts enabled) 0 1
chapter 17 interrupt functions user?s manual u19180ej1v0ud 610 17.4 interrupt servicing operations 17.4.1 maskable interrupt acknowledgement a maskable interrupt becomes acknowledgeable when the in terrupt request flag is set to 1 and the mask (mk) flag corresponding to that interrupt request is cleared to 0. a vectored interrupt request is acknowledged if interrupts are in the interrupt enabled state (when the ie flag is set to 1). however, a low-priority interrupt request is not acknowledged during servicing of a higher priority interrupt r equest (when the isp flag is reset to 0). the times from generation of a maskable interrupt requ est until interrupt servicing is perf ormed are listed in table 17-4 below. for the interrupt request acknowledgement timing, see figures 17-11 and 17-12 . table 17-4. time from generation of maskable interrupt until servicing minimum time maximum time note when pr = 0 7 clocks 32 clocks when pr = 1 8 clocks 33 clocks note if an interrupt request is generated just before a di vide instruction, the wait time becomes longer. remark 1 clock: 1/f cpu (f cpu : cpu clock) if two or more maskable interrupt requests are generated si multaneously, the request with a higher priority level specified in the priority specification flag is acknowledge d first. if two or more interrupts requests have the same priority level, the request with the highest default priority is acknowledged first. an interrupt request that is held pending is a cknowledged when it becomes acknowledgeable. figure 17-7 shows the interrupt request acknowledgement algorithm. if a maskable interrupt request is acknowledged, the content s are saved into the stacks in the order of psw, then pc, the ie flag is reset (0), and the contents of the priority specificat ion flag corresponding to the acknowledged interrupt are transferred to the isp flag. the vector table data determined for eac h interrupt request is the loaded into the pc and branched. restoring from an interrupt is possible by using the reti instruction.
chapter 17 interrupt functions user?s manual u19180ej1v0ud 611 figure 17-10. interrupt request acknowledgement processing algorithm start if = 1? mk = 0? pr = 0? ie = 1? isp = 1? interrupt request held pending yes yes no no yes (interrupt request generation) yes no (low priority) no no yes yes no ie = 1? no any high-priority interrupt request among those simultaneously generated with pr = 0? yes (high priority) no yes yes no vectored interrupt servicing interrupt request held pending interrupt request held pending interrupt request held pending interrupt request held pending interrupt request held pending interrupt request held pending vectored interrupt servicing any high-priority interrupt request among those simultaneously generated? any high-priority interrupt request among those simultaneously generated with pr = 0? if: interrupt request flag mk: interrupt mask flag pr: priority specification flag ie: flag that controls acknowledgement of mask able interrupt request (1 = enable, 0 = disable) isp: flag that indicates the priority level of the interrupt currently being serviced (0 = high-priority interrupt servicing, 1 = no interrupt request acknowledg ed, or low-priority interrupt servicing)
chapter 17 interrupt functions user?s manual u19180ej1v0ud 612 figure 17-11. interrupt request acknowledgement timing (minimum time) 8 clocks 7 clocks instruction instruction psw and pc saved, jump to interrupt servicing interrupt servicing program cpu processing if ( pr = 1) if ( pr = 0) 6 clocks remark 1 clock: 1/f cpu (f cpu : cpu clock) figure 17-12. interrupt request acknowledgement timing (maximum time) 33 clocks 32 clocks instruction divide instruction psw and pc saved, jump to interrupt servicing interrupt servicing program cpu processing if ( pr = 1) if ( pr = 0) 6 clocks 25 clocks remark 1 clock: 1/f cpu (f cpu : cpu clock) 17.4.2 software interrupt request acknowledgement a software interrupt acknowledge is acknowledged by brk instruction execution. software interrupts cannot be disabled. if a software interrupt request is ackn owledged, the content s are saved into the stacks in the order of the program status word (psw), then program counter (pc), the ie flag is reset (0), and t he contents of the ve ctor table (003eh, 003fh) are loaded into the pc and branched. restoring from a software interrupt is po ssible by using the retb instruction. caution do not use the reti instruction for restoring from the software interrupt.
chapter 17 interrupt functions user?s manual u19180ej1v0ud 613 17.4.3 multiple interrupt servicing multiple interrupt servicing occurs when another interrupt re quest is acknowledged during execution of an interrupt. multiple interrupt servicing does not occur unless the in terrupt request acknowledgement enabled state is selected (ie = 1). when an interrupt request is acknowledged, inte rrupt request acknowledgement becomes disabled (ie = 0). therefore, to enable multiple interrupt se rvicing, it is necessary to set (1) t he ie flag with the ei instruction during interrupt servicing to enable interrupt acknowledgement. moreover, even if interrupts are enabled, multiple interr upt servicing may not be enabled, this being subject to interrupt priority control. two types of priority control are available: default priority control and programmable priority control. programmable priority control is used for multiple interrupt servicing. in the interrupt enabled state, if an interrupt request with a priority equal to or higher than that of the interrupt currently being serviced is generated, it is acknowledged for mu ltiple interrupt servicing. if an interrupt with a priority lower than that of the interrupt currently being serviced is generated during interrupt servicing, it is not acknowledged for multiple interrupt servicing. interr upt requests that are not ena bled because interrupts are in the interrupt disabled state or because they have a lower priority are held pe nding. when servicing of the current interrupt ends, the pending interrupt request is acknowledged following execution of at least one main processi ng instruction execution. table 17-5 shows relationship between interrupt requests enabled for multiple interrupt servicing and figure 17-13 shows multiple interrupt servicing examples. table 17-5. relationship between interrupt requ ests enabled for multiple interrupt servicing during interrupt servicing maskable interrupt request pr = 0 pr = 1 multiple interrupt request interrupt being serviced ie = 1 ie = 0 ie = 1 ie = 0 software interrupt request isp = 0 { { maskable interrupt isp = 1 { { { software interrupt { { { remarks 1. : multiple interrupt servicing enabled 2. : multiple interrupt servicing disabled 3. isp and ie are flags contained in the psw. isp = 0: an interrupt with higher priority is being serviced. isp = 1: no interrupt request has been acknowledged, or an interrupt with a lower priority is being serviced. ie = 0: interrupt request acknowledgement is disabled. ie = 1: interrupt request acknowledgement is enabled. 4. pr is a flag contained in pr0l, pr0h, pr1l, and pr1h. pr = 0: higher priority level pr = 1: lower priority level
chapter 17 interrupt functions user?s manual u19180ej1v0ud 614 figure 17-13. examples of multip le interrupt se rvicing (1/2) example 1. multiple interrupt servicing occurs twice main processing intxx servicing intyy servicing intzz servicing ei ei ei reti reti reti intxx (pr = 1) intyy (pr = 0) intzz (pr = 0) ie = 0 ie = 0 ie = 0 ie = 1 ie = 1 ie = 1 during servicing of interrupt intxx, two interrupt req uests, intyy and intzz, are acknowledged, and multiple interrupt servicing takes place. before each interrupt req uest is acknowledged, the ei instruction must always be issued to enable interrupt request acknowledgment. example 2. multiple interrupt servicing does not occur due to priority control main processing intxx servicing intyy servicin g i ntxx ( pr = 0) intyy (pr = 1) ei reti ie = 0 ie = 0 ei 1 instruction execution reti ie = 1 ie = 1 interrupt request intyy issued during servicing of interrupt intxx is not acknowledged because its priority is lower than that of intxx, and mu ltiple interrupt servicing does not take place. the intyy interrupt request is held pending, and is acknowledged following execution of one main processing instruction. pr = 0: higher priority level pr = 1: lower priority level ie = 0: interrupt request acknowledgment disabled
chapter 17 interrupt functions user?s manual u19180ej1v0ud 615 figure 17-13. examples of multip le interrupt se rvicing (2/2) example 3. multiple interrupt servicing does not occur because interrupts are not enabled main processing intxx servicing intyy servicing ei 1 instruction execution reti reti intxx (pr = 0) intyy (pr = 0) ie = 0 ie = 0 ie = 1 ie = 1 interrupts are not enabled during servicin g of interrupt intxx (ei instruction is not issued), therefore, interrupt request intyy is not acknowledged and multiple interrupt serv icing does not take place. the intyy interrupt request is held pending, and is acknowledged following ex ecution of one main processing instruction. pr = 0: higher priority level ie = 0: interrupt request acknowledgement disabled
chapter 17 interrupt functions user?s manual u19180ej1v0ud 616 17.4.4 interrupt request hold there are instructions where, even if an interrupt request is issued for them while another instruction is being executed, request acknowledgement is held pending until the end of execution of the ne xt instruction. these instructions (interrupt request hol d instructions) are listed below. ? mov psw, #byte ? mov a, psw ? mov psw, a ? mov1 psw. bit, cy ? mov1 cy, psw. bit ? and1 cy, psw. bit ? or1 cy, psw. bit ? xor1 cy, psw. bit ? set1 psw. bit ? clr1 psw. bit ? retb ? reti ? push psw ? pop psw ? bt psw. bit, $addr16 ? bf psw. bit, $addr16 ? btclr psw. bit, $addr16 ? ei ? di ? manipulation instructions for the if0l, if0h, if1l, if1h, mk0l, mk0h, mk1l, mk1h, pr0l, pr0h, pr1l, and pr1h registers. caution the brk instruction is no t one of the above-listed interr upt request hold instructions. however, the software interrupt activated by executing the brk instruct ion causes the ie flag to be cleared. therefore, even if a maskable interrupt request is generated during execution of the brk instruction, the interrupt request is not acknowledged. figure 17-14 shows the timing at which interrupt requests are held pending. figure 17-14. interrupt request hold instruction n instruction m psw and pc saved, jump to interrupt servicing interrupt servicing program cpu processing if remarks 1. instruction n: interrupt request hold instruction 2. instruction m: instruction other t han interrupt request hold instruction 3. the pr (priority level) values do not affect the operation of if (instruction request).
user?s manual u19180ej1v0ud 617 chapter 18 standby function 18.1 standby function and configuration 18.1.1 standby function the standby function is mounted onto all 78k0/fx2 microcontroller products. the standby function is designed to reduce the operating current of the system. the following two modes are available. (1) halt mode halt instruction execution sets the ha lt mode. in the halt mode, the cp u operation clock is stopped. if the high-speed system clock oscillator, internal high-speed o scillator, internal low-speed oscillator, or subsystem clock oscillator is operating before the halt mode is set, oscillation of each clock continues. in this mode, the operating current is not decreased as much as in the stop mode, but the halt mode is effective for restarting operation immediately upon interrupt request gener ation and carrying out intermittent operations. (2) stop mode stop instruction execution sets the stop mode. in t he stop mode, the high-speed system clock oscillator and internal high-speed oscillator stop, stopping the whole sy stem, thereby considerably reducing the cpu operating current. because this mode can be cleared by an interrupt reques t, it enables intermittent operations to be carried out. however, because a wait time is required to secure th e oscillation stabilization time after the stop mode is released, select the halt mode if it is necessary to start processing immediately upon interrupt request generation. in either of these two modes, all the contents of registers, flags and data me mory just before the standby mode is set are held. the i/o port output latches an d output buffer statuses are also held. cautions 1. the stop mode can be used only when the cpu is operating on the main system clock. the subsystem clock oscillation cannot be stopped. the halt mode can be used when the cpu is operating on either the main system clock or the subsystem clock. 2. when shifting to the stop mode, be su re to stop the peripheral hardware operation operating with main system clock before executing stop instruction. 3. the following sequence is recommended for operating current reduction of the a/d converter when the standby function is used: first clear bit 7 (adcs) and bit 0 (adce) of the a/d converter mode register (adm) to 0 to stop the a/d conversion operation, and then execute the stop instruction. 18.1.2 registers controlling standby function the standby function is controlled by the following two registers. ? oscillation stabilization time c ounter status register (ostc) ? oscillation stabilization time select register (osts) remark for the registers that start, st op, or select the clock, see chapter 6 clock generator .
chapter 18 standby function user?s manual u19180ej1v0ud 618 (1) oscillation stabilization time counter status register (ostc) this is the register that indicates t he count status of the x1 clock oscill ation stabilization time counter. when x1 clock oscillation starts with the internal high-speed osci llation clock or subsystem clock used as the cpu clock, the x1 clock oscillation stabilization time can be checked. ostc can be read by a 1-bit or 8-bit memory manipulation instruction. when reset is released (reset by reset input, poc, lvi and wdt), the stop instruct ion and mstop (bit 7 of moc register) = 1 clear ostc to 00h. figure 18-1. format of oscillation stabilization time counter status register (ostc) address: ffa3h after reset: 00h r symbol 7 6 5 4 3 2 1 0 ostc 0 0 0 most11 most 13 most14 most15 most16 oscillation stabilization time status most 11 most 13 most 14 most 15 most 16 f x = 4 mhz f x = 5 mhz f x = 10 mhz f x = 20 mhz 1 0 0 0 0 2 11 /f x min. 512 s min. 409.6 s min. 204.8 s min. 102.4 s min. 1 1 0 0 0 2 13 /f x min. 2.05 ms min. 1.64 ms min. 819.2 s min. 409.6 s min. 1 1 1 0 0 2 14 /f x min. 4.10 ms min. 3.27 ms min. 1.64 ms min. 819.2 s min. 1 1 1 1 0 2 15 /f x min. 8.19 ms min. 6.55 ms mi n. 3.27 ms min. 1.64 ms min. 1 1 1 1 1 2 16 /f x min. 16.38 ms min. 13.11 ms mi n. 6.55 ms min. 3.27 ms min. cautions 1. after the above time has elapsed, the bits are set to 1 in order from most11 and remain 1. 2. the oscillation stabilization time counter counts up to the oscillation stabilization time set by osts. if the stop mode is entered and then released while the internal high-speed oscillation clock is being u sed as the cpu clock, set the oscillation stabilization time as follows. ? desired ostc oscilla tion stabilization time oscillation stabilization time set by osts note, therefore, that only the status up to the oscillation stabilization time set by osts is set to ostc after st op mode is released. 3. the x1 clock oscillation stabilization time does not include the time until clock oscillation starts (?a? below). a stop mode release x1 pin voltage waveform remark f x : x1 clock oscillation frequency
chapter 18 standby function user?s manual u19180ej1v0ud 619 (2) oscillation stabilization time select register (osts) this register is used to select the x1 clock oscillati on stabilization time when the st op mode is released. when the x1 clock is selected as the cpu clock, the operati on waits for the time set usin g osts after the stop mode is released. when the internal high-speed oscillation clock is selected as the cpu clock, confirm wi th ostc that the desired oscillation stabilization time has elaps ed after the stop mode is released. t he oscillation stabilization time can be checked up to the time set using ostc. osts can be set by an 8-bit memo ry manipulation instruction. reset signal generation sets osts to 05h. figure 18-2. format of oscillation stabiliz ation time select register (osts) address: ffa4h after reset: 05h r/w symbol 7 6 5 4 3 2 1 0 osts 0 0 0 0 0 osts2 osts1 osts0 osts2 osts1 osts0 oscillation stabilization time selection f x = 4 mhz f x = 5 mhz f x = 10 mhz f x = 20 mhz 0 0 1 2 11 /f x 512 s 409.6 s 204.8 s 102.4 s 0 1 0 2 13 /f x 2.05 ms 1.64 ms 819.2 s 409.6 s 0 1 1 2 14 /f x 4.10 ms 3.27 ms 1.64 ms 819.2 s 1 0 0 2 15 /f x 8.19 ms 6.55 ms 3.27 ms 1.64 ms 1 0 1 2 16 /f x 16.38 ms 13.11 ms 6.55 ms 3.27 ms other than above setting prohibited cautions 1. to set the stop mode when the x1 cl ock is used as the cpu clock, set osts before executing the stop instruction. 2. do not change the value of the osts register during the x1 clock oscillation stabilization time. 3. the oscillation stabilization time counter counts up to the oscillation stabilization time set by osts. if the stop mode is entered and then released while the internal high-speed oscillation clock is being u sed as the cpu clock, set the oscillation stabilization time as follows. ? desired ostc oscillation stabilization time oscillation stabilization time set by osts note, therefore, that only the status up to the oscillation stabilization time set by osts is set to ostc after st op mode is released. 4. the x1 clock oscillation stabilization time does not include the time until clock oscillation starts (?a? below). a stop mode release x1 pin voltage waveform remark f x : x1 clock oscillation frequency
chapter 18 standby function user?s manual u19180ej1v0ud 620 18.2 standby function operation 18.2.1 halt mode (1) halt mode the halt mode is set by executing the halt instructi on. halt mode can be set r egardless of whether the cpu clock before the setting was the high-speed system clock, internal high-speed oscillation clock, or subsystem clock. the operating statuses in t he halt mode are shown below.
chapter 18 standby function user?s manual u19180ej1v0ud 621 table 18-1. operating statuses in halt mode (1/2) when halt instruction is executed while cpu is operating on main system clock halt mode setting item when cpu is operating on internal high-speed oscillation clock (f rh ) when cpu is operating on x1 clock (f x ) when cpu is operating on external main system clock (f exclk ) system clock clock supply to the cpu is stopped f rh operation continues (cannot be stopped) status before halt mode was set is retained f x status before halt mode was set is retained operation continues (cannot be stopped) status before halt mode was set is retained main system clock f exclk operates or stops by external cl ock input operation continues (cannot be stopped) f xt status before halt mode was set is retained subsystem clock f exclks operates or stops by external clock input f rl status before halt mode was set is retained cpu operation stopped flash memory operation stopped ram status before halt mode was set is retained port (latch) status before halt mode was set is retained 00 01 02 16-bit timer/event counter 03 50 8-bit timer/event counter 51 h0 8-bit timer h1 watch timer operable watchdog timer operable. clock suppl y to watchdog timer stops when ?i nternal low-speed oscillator can be stopped by software? is set by option byte. clock output buzzer output a/d converter uart60 uart61 csi10 serial interface csi11 can controller multiplier/divider power-on-clear function low-voltage detection function external interrupt operable remarks 1. f rh : internal high-speed oscillation clock, f x : x1 clock f exclk : external main system clock, f xt : xt1 clock f exclks : external subsystem clockm f rl : internal low-speed oscillation clock 2. the functions mounted depend on the product. see 1.7 block diagram and 1.8 outline of functions .
chapter 18 standby function user?s manual u19180ej1v0ud 622 table 18-1. operating statuses in halt mode (2/2) when halt instruction is executed while cpu is operating on subsystem clock halt mode setting item when cpu is operating on xt1 clock (f xt ) when cpu is operating on external subsystem clock (f exclks ) system clock clock supply to the cpu is stopped f rh f x status before halt mode was set is retained main system clock f exclk operates or stops by external clock input f xt operation continues (cannot be stopped) stat us before halt mode was set is retained subsystem clock f exclks operates or stops by external clock input operation continues (cannot be stopped) f rl status before halt mode was set is retained cpu operation stopped flash memory operation stopped ram status before halt mode was set is retained port (latch) status before halt mode was set is retained 00 note 01 note 02 note 16-bit timer/event counter 03 note 50 note 8-bit timer/event counter 51 note h0 8-bit timer h1 watch timer operable watchdog timer operable. clock supply to watchdog timer st ops when ?internal low- speed oscillator can be stopped by software? is set by option byte. clock output operable buzzer output operable. however, operati on disabled when peripheral hardware clock (f prs ) is stopped. a/d converter uart60 uart61 csi10 note serial interface csi11 note can controller multiplier/divider power-on-clear function low-voltage detection function external interrupt operable note when the cpu is operating on the s ubsystem clock and the internal high-speed oscillation clock has been stopped, do not start operation of these functions on the external clo ck input from peripheral hardware pins. remarks 1. f rh : internal high-speed oscillation clock, f x : x1 clock f exclk : external main system clock, f xt : xt1 clock f exclks : external subsystem clock, f rl : internal low-speed oscillation clock 2. the functions mounted depend on the product. see 1.7 block diagram and 1.8 outline of functions .
chapter 18 standby function user?s manual u19180ej1v0ud 623 (2) halt mode release the halt mode can be released by the following two sources. (a) release by unmasked interrupt request when an unmasked interrupt request is generated, the halt mode is released. if interrupt acknowledgement is enabled, vectored interrupt servicing is carried out. if interrupt acknowledgement is disabled, the next address instruction is executed. figure 18-3. halt mode release by interrupt request generation halt instruction wait operating mode halt mode operating mode oscillation high-speed system clock, internal high-speed oscillation clock, or subsystem clock status of cpu standby release signal interrupt request note note the wait time is as follows: ? when vectored interrupt servicing is carried out: 11 or 12 clocks ? when vectored interrupt servicing is not carried out: 4 or 5 clocks remark the broken lines indicate the case when the interrupt request which has released the standby mode is acknowledged.
chapter 18 standby function user?s manual u19180ej1v0ud 624 (b) release by reset signal generation when the reset signal is generated, halt mode is rel eased, and then, as in the case with a normal reset operation, the program is executed after br anching to the reset vector address. figure 18-4. halt mode release by reset (1) when high-speed system clock is used as cpu clock halt instruction reset signal high-speed system clock (x1 oscillation) halt mode reset period oscillates oscillation stopped oscillates status of cpu normal operation (high-speed system clock) oscillation stabilization time (2 11 /f x to 2 16 /f x ) normal operation (internal high-speed oscillation clock) oscillation stopped starting x1 oscillation is specified by software. reset processing (11 to 45 s) (2) when internal high-speed osc illation clock is used as cpu clock halt instruction reset signal internal high-speed oscillation clock normal operation (internal high-speed oscillation clock) halt mode reset period normal operation (internal high-speed oscillation clock) oscillates oscillation stopped oscillates status of cpu wait for oscillation accuracy stabilization (86 to 361 s) reset processing (11 to 45 s) (3) when subsystem clock is used as cpu clock halt instruction reset signal subsystem clock (xt1 oscillation) normal operation (subsystem clock) halt mode reset period normal operation mode (internal high-speed oscillation clock) oscillates oscillation stopped oscillates status of cpu oscillation stopped starting xt1 oscillation is specified by software. reset processing (11 to 45 s) remark f x : x1 clock oscillation frequency
chapter 18 standby function user?s manual u19180ej1v0ud 625 table 18-2. operation in response to interrupt request in halt mode release source mk pr ie isp operation 0 0 0 next address instruction execution 0 0 1 interrupt servicing execution 0 1 0 1 0 1 0 next address instruction execution 0 1 1 1 interrupt servicing execution maskable interrupt request 1 halt mode held reset signal input ? ? reset processing : don?t care 18.2.2 stop mode (1) stop mode setting and operating statuses the stop mode is set by executing the stop instructi on, and it can be set only when the cpu clock before the setting was the main system clock. caution because the interrupt request signal is used to clear the standby mode, if there is an interrupt source with the interrupt request flag set and the interrupt mask flag reset, the standby mode is immediately cleared if set. thus, the stop mode is reset to the halt mode immediately after execution of the stop instruction and th e system returns to the operating mode as soon as the wait time set using the oscillation stabiliz ation time select regist er (osts) has elapsed. the operating statuses in t he stop mode are shown below.
chapter 18 standby function user?s manual u19180ej1v0ud 626 table 18-3. operating statuses in stop mode when stop instruction is executed while cpu is operating on main system clock stop mode setting item when cpu is operating on internal high-speed oscillation clock (f rh ) when cpu is operating on x1 clock (f x ) when cpu is operating on external main system clock (f exclk ) system clock clock supply to the cpu is stopped f rh f x stopped main system clock f exclk input invalid f xt status before stop mode was set is retained subsystem clock f exclks operates or stops by external clock input f rl status before stop mode was set is retained cpu operation stopped flash memory operation stopped ram status before stop mode was set is retained port (latch) status before stop mode was set is retained 00 note 01 note 02 note 16-bit timer/event counter 03 note operation stopped 50 note operable only when ti50 is selected as the count clock 8-bit timer/event counter 51 note operable only when ti51 is selected as the count clock h0 operable only when tm50 output is selected as the count clock during 8-bit timer/event counter 50 operation 8-bit timer h1 operable only when f rl , f rl /2 7 , f rl /2 9 is selected as the count clock watch timer operable only when subsystem clock is selected as the count clock watchdog timer operable. clock suppl y to watchdog timer stops when ?i nternal low-speed oscillator can be stopped by software? is set by option byte. clock output operable only when subsystem clock is selected as the count clock buzzer output operation stopped a/d converter uart60 uart61 operable only when tm50 output is selected as the serial clock during 8-bi t timer/event counter 50 operation csi10 note serial interface csi11 note operable only when external clock is selected as the serial clock can controller operable. can be woken up from sleep mode. multiplier/divider operation stopped power-on-clear function low-voltage detection function external interrupt operable note do not start operation of these func tions on the external clock input from peripheral hardware pins in the stop mode. (cautions and remarks are listed on the next page.)
chapter 18 standby function user?s manual u19180ej1v0ud 627 cautions 1. to use the peripheral hardware that stops operation in the stop mode, and the peripheral hardware for which the clock that stops oscillati ng in the stop mode after the stop mode is released, restart the peripheral hardware. 2. even if ?internal low-speed oscillator can be stopped by software? is selected by the option byte, the internal low-speed osc illator continues in the stop mo de in the status before the stop mode is set. to stop the internal low-speed oscillator in the stop mode, stop it by software and then execute the stop instruction. 3. to shorten oscillation stabiliz ation time after the stop mode is released when the cpu operates with the high-speed system clo ck (x1 oscillation), temporarily switch the cpu clock to the internal high-speed oscillator in ternal oscillation clock before the next execution of the stop instruction. before changing th e cpu clock from the internal hi gh-speed oscillator to the high- speed system clock (x1 oscillation) after th e stop mode is released, check the oscillation stabilization time with the oscillation stabilization time counter status register (ostc). 4. if the stop instruction is executed when amph = 1, supply of the cpu clock is stopped for 4.06 to 16.12 s after the stop mode is re leased when the internal hi gh-speed oscillation clock is selected as the cpu clock, or for the duration of 160 external clocks when the high-speed system clock (external clock input) is selected as the cpu clock. 5. execute the stop instruction after having confirmed that the in ternal high-speed oscillator is operating stably (rsts = 1). remarks 1. f rh : internal high-speed oscillation clock, f x : x1 clock f exclk : external main system clock, f xt : xt1 clock f exclks : external subsystem clock, f rl : internal low-speed oscillation clock 2. the functions mounted depend on the product. see 1.7 block diagram and 1.8 outline of functions .
chapter 18 standby function user?s manual u19180ej1v0ud 628 (2) stop mode release figure 18-5. operation timing wh en stop mode is released (when unmasked interrupt request is generated) stop mode stop mode release high-speed system clock (x1 oscillation) high-speed system clock (external clock input) internal high-speed oscillation clock high-speed system clock (x1 oscillation) is selected as cpu clock when stop instruction is executed high-speed system clock (external clock input) is selected as cpu clock when stop instruction is executed internal high-speed oscillation clock is selected as cpu clock when stop instruction is executed wait for oscillation accuracy stabilization (86 to 361 s) halt status (oscillation stabilization time set by osts) clock switched by software clock switched by software high-speed system clock high-speed system clock wait note2 wait note2 supply of the cpu clock is stopped (4.06 to 16.12 s) note1 high-speed system clock supply of the cpu clock is stopped (160 external clocks) note1 internal high-speed oscillation clock notes 1. when amph = 1 2. the wait time is as follows: ? when vectored interrupt servicing is carried out: 17 or 18 clocks ? when vectored interrupt servicing is not carried out: 11 or 12 clocks the stop mode can be released by the following two sources.
chapter 18 standby function user?s manual u19180ej1v0ud 629 (a) release by unmasked interrupt request when an unmasked interrupt request is generated, the stop mode is released. after the oscillation stabilization time has elapsed, if interrupt acknowledg ment is enabled, vectored interrupt servicing is carried out. if interrupt acknowledgment is disabled, the next address inst ruction is executed. figure 18-6. stop mode release by interrupt request generation (1/2) (1) when high-speed system clock (x1 oscillation) is used as cpu clock normal operation (high-speed system clock) normal operation (high-speed system clock) oscillates oscillates stop instruction stop mode wait (set by osts) standby release signal oscillation stabilization wait (halt mode status) oscillation stopped high-speed system clock (x1 oscillation) status of cpu oscillation stabilization time (set by osts) interrupt request (2) when high-speed system clock (external clock input) is used as cpu clock (1/2) ? when amph = 1 interrupt request stop instruction standby release signal status of cpu high-speed system clock (external clock input) oscillates normal operation (high-speed system clock) stop mode oscillation stopped oscillates normal operation (high-speed system clock) wait note supply of the cpu clock is stopped (160 external clocks) note the wait time is as follows: ? when vectored interrupt servicing is carried out: 17 or 18 clocks ? when vectored interrupt servicing is not carried out: 11 or 12 clocks remark the broken lines indicate the case when the inte rrupt request that has released the standby mode is acknowledged.
chapter 18 standby function user?s manual u19180ej1v0ud 630 figure 18-6. stop mode release by interrupt request generation (2/2) (2) when high-speed system clock (external clock input) is used as cpu clock (2/2) ? when amph = 0 interrupt request stop instruction standby release signal status of cpu high-speed system clock (external clock input) normal operation (high-speed system clock) oscillates stop mode oscillation stopped wait note normal operation (high-speed system clock) oscillates (3) when internal high-speed osc illation clock is used as cpu clock ? when amph = 1 (4.06 to 16.12 s) standby release signal status of cpu internal high-speed oscillation clock normal operation (internal high-speed oscillation clock) oscillates stop mode oscillation stopped wait for oscillation accuracy stabilization (86 to 361 s) interrupt request stop instruction wait note normal operation (internal high-speed oscillation clock) supply of the cpu clock is stopped oscillates ? when amph = 0 wait note wait for oscillation accuracy stabilization (86 to 361 s) oscillates normal operation (internal high-speed oscillation clock) stop mode oscillation stopped oscillates normal operation (internal high-speed oscillation clock) internal high-speed oscillation clock status of cpu standby release signal stop instruction interrupt request note the wait time is as follows: ? when vectored interrupt servicing is carried out: 17 or 18 clocks ? when vectored interrupt servicing is not carried out: 11 or 12 clocks remark the broken lines indicate the case when the inte rrupt request that has released the standby mode is acknowledged.
chapter 18 standby function user?s manual u19180ej1v0ud 631 (b) release by reset signal generation when the reset signal is generated, stop mode is rele ased, and then, as in the case with a normal reset operation, the program is executed after br anching to the reset vector address. figure 18-7. stop mode release by reset (1) when high-speed system clock is used as cpu clock stop instruction reset signal high-speed system clock (x1 oscillation) normal operation (high-speed system clock) stop mode reset period normal operation (internal high-speed oscillation clock) oscillates oscillation stopped oscillates status of cpu oscillation stabilization time (2 11 /f x to 2 16 /f x ) oscillation stopped starting x1 oscillation is specified by software. oscillation stopped reset processing (11 to 45 s) (2) when internal high-speed osc illation clock is used as cpu clock stop instruction reset signal internal high-speed oscillation clock normal operation (internal high-speed oscillation clock) stop mode reset period normal operation (internal high-speed oscillation clock) oscillates oscillation stopped status of cpu oscillates oscillation stopped wait for oscillation accuracy stabilization (86 to 361 s) reset processing (11 to 45 s) remark f x : x1 clock oscillation frequency table 18-4. operation in response to interrupt request in stop mode release source mk pr ie isp operation 0 0 0 next address instruction execution 0 0 1 interrupt servicing execution 0 1 0 1 0 1 0 next address instruction execution 0 1 1 1 interrupt servicing execution maskable interrupt request 1 stop mode held reset signal input ? ? reset processing : don?t care
user?s manual u19180ej1v0ud 632 chapter 19 reset function the reset function is mounted onto all 78k0/fx2 microcontroller products. the following four operations are available to generate a reset signal. (1) external reset input via reset pin (2) internal reset by watchdog timer program loop detection (3) internal reset by comparison of supply voltage and detection voltage of power-on-clear (poc) circuit (4) internal reset by comparison of supply voltage and detection voltage of low-power-supply detector (lvi) external and internal resets have no functional differences . in both cases, program ex ecution starts at the address at 0000h and 0001h when the reset signal is generated. a reset is applied when a low level is input to the reset pin, the watchdog timer overflows, or by poc and lvi circuit voltage detection, and each item of hardware is set to the status shown in tables 19-1 and 19-2. each pin is high impedance during reset signal generation or during the osci llation stabilization time just after a reset release, except for p130, which is low-level output. when a low level is input to the reset pin, the device is reset. it is released from the reset status when a high level is input to the reset pin and program execution is st arted with the internal high-speed oscillation clock after reset processing. a reset by the watchdog timer is autom atically released, and program execution starts using the internal high-speed oscillation clock (see figures 19-2 to 19-4 ) after reset processing. reset by poc and lvi circuit power supply detection is automatically released when v dd v poc or v dd v lvi after the reset, and program execution starts using the internal high-speed oscillation clock (see chapter 21 power-on-clear circuit and chapter 22 low-voltage detector ) after reset processing. cautions 1. for an external reset, input a low level for 10 s or more to the reset pin. 2. during reset input, the x1 clock, xt1 clock, in ternal high-speed o scillation clock, and internal low-speed oscillation clock stop oscilla ting. external main system clock input and external subsystem clock input become invalid. 3. when the stop mode is released by a reset, the stop mode contents are held during reset input. however, the port pins become high-impedance, except fo r p130, which is set to low-level output.
chapter 19 reset function user?s manual u19180ej1v0ud 633 figure 19-1. block di agram of reset function lvirf wdtrf reset control flag register (resf) internal bus watchdog timer reset signal reset power-on-clear circuit reset signal low-voltage detector reset signal reset signal reset signal to lvim/lvis register clear set clear set resf register read signal caution an lvi circuit internal reset does not reset the lvi circuit. remarks 1. lvim: low-voltage detection register 2. lvis: low-voltage detection level selection register
chapter 19 reset function user?s manual u19180ej1v0ud 634 figure 19-2. timing of reset by reset input delay delay (5 s (typ.)) hi-z normal operation cpu clock reset period (oscillation stop) normal operation (internal high-speed oscillation clock) reset internal reset signal port pin (except p130) port pin (p130) note high-speed system clock (when x1 oscillation is selected) internal high-speed oscillation clock starting x1 oscillation is specified by software. reset processing (11 to 45 s) wait for oscillation accuracy stabilization (86 to 361 s) note set p130 to high-level output by software. remark when reset is effected, p130 outputs a low level. if p130 is set to output a high level before reset is effected, the output signal of p130 ca n be dummy-output as the cpu reset signal. figure 19-3. timing of reset due to watchdog timer overflow normal operation reset period (oscillation stop) cpu clock watchdog timer overflow internal reset signal hi-z port pin (except p130) port pin (p130) note high-speed system clock (when x1 oscillation is selected) internal high-speed oscillation clock starting x1 oscillation is specified by software. normal operation (internal high-speed oscillation clock) reset processing (11 to 45 s) wait for oscillation accuracy stabilization (86 to 361 s) note set p130 to high-level output by software. caution a watchdog timer internal reset resets the watchdog timer. remark when reset is effected, p130 outputs a low level. if p130 is set to output a high level before reset is effected, the output signal of p130 ca n be dummy-output as the cpu reset signal.
chapter 19 reset function user?s manual u19180ej1v0ud 635 figure 19-4. timing of reset in stop mode by reset input delay normal operation cpu clock reset period (oscillation stop) reset internal reset signal stop instruction execution stop status (oscillation stop) high-speed system clock (when x1 oscillation is selected) internal high-speed oscillation clock hi-z port pin (except p130) port pin (p130) note starting x1 oscillation is specified by software. normal operation (internal high-speed oscillation clock) reset processing (11 to 45 s) delay (5 s (typ.)) wait for oscillation accuracy stabilization (86 to 361 s) note set p130 to high-level output by software. remarks 1. when reset is effected, p130 outputs a low level. if p130 is set to output a high level before reset is effected, the output signal of p130 ca n be dummy-output as the cpu reset signal. 2. for the reset timing of the power-on-cl ear circuit and low-voltage detector, see chapter 21 power-on-clear circuit and chapter 22 low-voltage detector .
chapter 19 reset function user?s manual u19180ej1v0ud 636 table 19-1. operation st atuses during reset period item during reset period system clock clock supply to the cpu is stopped. f rh operation stopped f x operation stopped (pin is i/o port mode) main system clock f exclk clock input invalid (pin is i/o port mode) f xt operation stopped (pin is i/o port mode) subsystem clock f exclks clock input invalid (pin is i/o port mode) f rl cpu flash memory ram operation stopped regulator operable port (latch) 00 01 02 16-bit timer/event counter 03 50 8-bit timer/event counter 51 h0 8-bit timer h1 watch timer watchdog timer clock output buzzer output a/d converter uart60 uart61 csi10 serial interface csi11 can controller multiplier/divider operation stopped power-on-clear function operable low-voltage detection function external interrupt operation stopped remarks 1. f rh : internal high-speed oscillation clock, f x : x1 oscillation clock f exclk : external main system clock, f xt : xt1 oscillation clock f exclks : external subsystem clock, f rl : internal low-speed oscillation clock 2. the functions mounted depend on the product. see 1.7 block diagram and 1.8 outline of functions .
chapter 19 reset function user?s manual u19180ej1v0ud 637 table 19-2. hardware statuses after reset acknowledgment (1/3) hardware after reset acknowledgment note 1 program counter (pc) the contents of the reset vector table (0000h, 0001h) are set. stack pointer (sp) undefined program status word (psw) 02h data memory undefined note 2 ram general-purpose registers undefined note 2 port registers (p0, p1, p3 to p9, p12, p13) (output latches) 00h pm0, pm1, pm3 to pm9, pm12 ffh port mode registers pm13 feh pull-up resistor option registers (pu0, pu1, pu3 to pu7, pu12, pu13) 00h internal expansion ram size switching register (ixs) 0ch note 3 internal memory size switching register (ims) cfh note 3 bank select register (bank) 00h processor clock control register (pcc) 01h clock operation mode select register (oscctl) 00h internal oscillator mode register (rcm) 00h note 4 main clock mode register (mcm) 00h main osc control register (moc) 80h oscillation stabilization time select register (osts) 05h oscillation stabilization time counter status register (ostc) 00h notes 1. during reset signal generation or oscillation st abilization time wait, only the pc contents among the hardware statuses become undefined. all other hardware statuses remain unchanged after reset. 2. when a reset is executed in the standby mode, the pre-reset status is held even after reset. 3. the initial values of the internal memory size sw itching register (ims) and internal expansion ram size switching register (ixs) after a reset release are c onstant (ims = cfh, ixs = 0ch) in all the 78k0/fx2 microcontrollers, regardless of the internal memory capa city. therefore, after a reset is released, be sure to set the following values for each product. flash memory version (78k0/fx2 microcontrollers) ims ixs pd78f0881a, 78f0884a cfh 08h pd78f0882a, 78f0885a, 78f0887a cch 04h pd78f0883a, 78f0886a, 78f0888a, 78f0891a cch 04h pd78f0889a, 78f0892a, 78f0894a cch 04h pd78f0890a, 78f0893a, 78f0895a cch 00h 4. the value of this register is 00h immediately after a reset release but automatically changes to 80h after internal high-speed oscillation has been stabilized. remark the functions mounted depend on the product. see 3.2.3 special function registers (sfrs) .
chapter 19 reset function user?s manual u19180ej1v0ud 638 table 19-2. hardware statuses after reset acknowledgment (2/3) hardware status after reset acknowledgment note 1 timer counters 00-03 (tm00-tm03) 0000h capture/compare registers 000-003, 010-013(cr000-cr003, cr010-cr013) 0000h mode control registers 00-03 (tmc00-tmc03) 00h prescaler mode registers 00-03 (prm00-prm03) 00h capture/compare control registers 00-03 (crc00-crc03) 00h 16-bit timer/event counters 00-03 timer output control registers 00-03 (toc00- toc03) 00h timer counters 50, 51 (tm50, tm51) 00h compare registers 50, 51 (cr50, cr51) 00h timer clock selection registers 50, 51 (tcl50, tcl51) 00h 8-bit timer/event counters 50, 51 mode control registers 50, 51 (tmc50, tmc51) 00h compare registers 00, 10, 01, 11 (cmp00, cmp10, cmp01, cmp11) 00h mode registers (tmhmd0, tmhmd1) 00h 8-bit timers h0, h1 carrier control register 1 (tmcyc1) note 2 00h watch timer operation mode register (wtm) 00h clock output/buzzer output controller clock output selection register (cks) 00h watchdog timer enable register (wdte) 1ah/9ah note 3 10-bit a/d conversion result register (adcr) 0000h 8-bit a/d conversion result register (adcrh) 00h mode register (adm) 00h analog input channel specific ation register (ads) 00h a/d converter a/d port configuration register (adpc) 00h receive buffer register 60, 61 (rxb60, rxb61) ffh transmit buffer register 60, 61 (txb60, txb61) ffh asynchronous serial interface operation m ode register 60, 61 (asim60, asim61) 01h asynchronous serial interface reception error status register 60, 61 (asis60, asis61) 00h asynchronous serial interface transmis sion status register 60, 61 (asif60, asif61) 00h clock selection register 60, 61 (cksr60, cksr61) 00h baud rate generator control register 60, 61 (brgc60, brgc61) ffh asynchronous serial interface control r egister 60, 61 (asicl60, asicl61) 16h serial interface uart60, uart61 input switch control register (isc) 00h notes 1. during reset signal generation or oscillation st abilization time wait, only the pc contents among the hardware statuses become undefined. all other hardware statuses remain unchanged after reset. 2. 8-bit timer h1 only. 3. the reset value of wdte is determined by the option byte setting. remark the functions mounted depend on the product. see 3.2.3 special function registers (sfrs) .
chapter 19 reset function user?s manual u19180ej1v0ud 639 table 19-2. hardware statuses after reset acknowledgment (3/3) hardware status after reset acknowledgment note 1 transmit buffer registers 10, 11 (sotb10, sotb11) 00h serial i/o shift registers 10, 11 (sio10, sio11) 00h serial operation mode registers 10, 11 (csim10, csim11) 00h serial interfaces csi10, csi11 serial clock selection registers 10, 11 (csic10, csic11) 00h remainder data register 0 (sdr0) 0000h multiplication/division data regi ster a0 (mda0h, mda0l) 0000h multiplication/division data register b0 (mdb0) 0000h multiplier/divider multiplier/divider control register 0 (dmuc0) 00h reset function reset control flag register (resf) 00h note2 low-voltage detection register (lvim) 00h note2 low-voltage detector low-voltage detection level selection register (lvis) 00h note2 request flag registers 0l, 0h, 1l, 1h (if0l, if0h, if1l, if1h) 00h mask flag registers 0l, 0h, 1l, 1h (mk0l, mk0h, mk1l, mk1h) ffh priority specification flag registers 0l, 0h, 1l, 1h (pr0l, pr0h, pr1l, pr1h) ffh external interrupt rising edge enable register (egp) 00h interrupt external interrupt falling edge enable register (egn) 00h notes 1. during reset signal generation or oscillation st abilization time wait, only the pc contents among the hardware statuses become undefined. all other hardware statuses remain unchanged after reset. 2. these values vary depending on the reset source. reset source register reset input reset by poc reset by wdt reset by lvi wdtrf bit set (1) held resf lvirf bit cleared (0) cleared (0) held set (1) lvim lvis cleared (00h) cleared (00h) cleared (00h) held remark the functions mounted depend on the product. see 3.2.3 special function registers (sfrs) .
chapter 19 reset function user?s manual u19180ej1v0ud 640 19.1 register for confirming reset source many internal reset generation sources exist in the 78k0/ fx2 microcontrollers. the reset control flag register (resf) is used to store which source has generated the reset request. resf can be read by an 8-bit memory manipulation instruction. reset input, reset input by power-on-clear (poc ) circuit, and reading resf clear resf to 00h. figure 19-5. format of reset control flag register (resf) address: ffach after reset: 00h note r symbol 7 6 5 4 3 2 1 0 resf 0 0 0 wdtrf 0 0 0 lvirf wdtrf internal reset request by watchdog timer (wdt) 0 internal reset request is not generated, or resf is cleared. 1 internal reset request is generated. lvirf internal reset request by low-voltage detector (lvi) 0 internal reset request is not generated, or resf is cleared. 1 internal reset request is generated. note the value after reset varies depending on the reset source. caution do not read data by a 1-bit memory manipulation instruction. the status of resf when a reset request is generated is shown in table 19-3. table 19-3. resf status when reset request is generated reset source flag reset input reset by poc reset by wdt reset by lvi wdtrf set (1) held lvirf cleared (0) cleared (0) held set (1)
user?s manual u19180ej1v0ud 641 chapter 20 multiplier/divider 20.1 functions of multiplier/divider the multiplier/divider is mounted onto all 78k0/fx2 microcontroller products. the multiplier/divider has the following functions. ? 16 bits 16 bits = 32 bits (multiplication) ? 32 bits 16 bits = 32 bits, 16-bit remainder (division) 20.2 configuration of multiplier/divider the multiplier/divider includes the following hardware. table 20-1. configuration of multiplier/divider item configuration registers remainder data register 0 (sdr0) multiplication/division data registers a0 (mda0h, mda0l) multiplication/division data registers b0 (mdb0) control register multiplier/divider control register 0 (dmuc0) figure 20-1 shows the block diagram of the multiplier/divider.
chapter 20 multiplier/divider user?s manual u19180ej1v0ud 642 figure 20-1. block diagram of multiplier/divider internal bus cpu clock start clear 17-bit adder controller multiplication/division data register b0 (mdb0 (mdb0h + mdb0l) remainder data register 0 (sdr0 (sdr0h + sdr0l) 6-bit counter dmusel0 multiplier/divider control register 0 (dmuc0) controller multiplication/division data register a0 ( mda0h (mda0hh + mda0hl) + mda0l (mda0lh + mda0ll) ) controller dmue mda000 intdmu
chapter 20 multiplier/divider user?s manual u19180ej1v0ud 643 (1) remainder data register 0 (sdr0) sdr0 is a 16-bit register that stor es a remainder. this register stor es 0 in the multiplication mode and the remainder of an operation result in the division mode. sdr0 can be read by an 8-bit or 16-bit memory manipulation instruction. reset signal generation clears sdr0 to 0000h. figure 20-2. format of remainder data register 0 (sdr0) address: ff44h, ff45h after reset: 0000h r symbol ff45h (sdr0h) ff44h (sdr0l) sdr0 sdr 015 sdr 014 sdr 013 sdr 012 sdr 011 sdr 010 sdr 009 sdr 008 sdr 007 sdr 006 sdr 005 sdr 004 sdr 003 sdr 002 sdr 001 sdr 000 cautions 1. the value read from sdr0 durin g operation processing (while bit 7 (dmue) of multiplier/divider control register 0 (dmuc0) is 1) is not guaranteed. 2. sdr0 is reset when the operation is started (when dmue is set to 1). (2) multiplication/division data register a0 (mda0h, mda0l) mda0 is a 32-bit register that sets a 16-bit multiplier a in the multiplication mode and a 32-bit dividend in the division mode, and stores the 32-bit re sult of the operation (higher 16 bits: mda0h, lower 16 bits: mda0l). figure 20-3. format of multiplication/division data register a0 (mda0h, mda0l) address: ff4ah, ff4bh, ff4ch, ff4dh after reset: 0000h, 0000h r/w symbol ff4dh (mda0hh) ff4ch (mda0hl) mda0h mda 031 mda 030 mda 029 mda 028 mda 027 mda 026 mda 025 mda 024 mda 023 mda 022 mda 021 mda 020 mda 019 mda 018 mda 017 mda 016 symbol ff4bh (mda0lh) ff4ah (mda0ll) mda0l mda 015 mda 014 mda 013 mda 012 mda 011 mda 010 mda 009 mda 008 mda 007 mda 006 mda 005 mda 004 mda 003 mda 002 mda 001 mda 000 cautions 1. mda0h is cleared to 0 when an operation is started in the multiplication mode (when multiplier/divider control register 0 (dmuc0) is set to 81h). 2. do not change the value of mda0 during operation processing (while bit 7 (dmue) of multiplier/divider control register 0 (dmuc0) is 1). even in this case, the operation is executed, but the result is undefined. 3. the value read from mda0 during operation processing (while dmue is 1) is not guaranteed.
chapter 20 multiplier/divider user?s manual u19180ej1v0ud 644 the functions of mda0 when an operation is executed are shown in the table below. table 20-2. functions of mda0 during operation execution dmusel0 operation mode setting operation result 0 division mode dividend divi sion result (quotient) 1 multiplication mode higher 16 bits: 0, lower 16 bits: multiplier a multiplication result (product) the register configuration differs between when multiplication is executed and when division is executed, as follows. ? register configuration during multiplication mda0 (bits 15 to 0) mdb0 (bits 15 to 0) = mda0 (bits 31 to 0) ? register configuration during division mda0 (bits 31 to 0) mdb0 (bits 15 to 0) = mda0 (bit s 31 to 0) ? sdr0 (bits 15 to 0) mda0 fetches the calculation result as soon as the cloc k is input, when bit 7 (dmue) of multiplier/divider control register 0 (dmuc0) is set to 1. mda0h and mda0l can be set by an 8-bit or 16-bit memory manipulation instruction. reset signal generation clears mda0h and mda0l to 0000h. (3) multiplication/division data register b0 (mdb0) mdb0 is a register that stores a 16 -bit multiplier b in the multiplication mode and a 16-bit divisor in the division mode. mdb0 can be set by an 8-bit or 16-bi t memory manipulati on instruction. reset signal generation clears mdb0 to 0000h. figure 20-4. format of multiplication/division data register b0 (mdb0) address: ffaeh, ffafh after reset: 0000h r/w symbol ffafh (mdb0h) ffaeh (mdb0l) mdb0 mdb 015 mdb 014 mdb 013 mdb 012 mdb 011 mdb 010 mdb 009 mdb 008 mdb 007 mdb 006 mdb 005 mdb 004 mdb 003 mdb 002 mdb 001 mdb 000 cautions 1. do not change the value of mdb0 during operation processing (while bit 7 (dmue) of multiplier/divider control register 0 (dmuc0) is 1). even in this case, the operation is executed, but the result is undefined. 2. do not clear mdb0 to 0000h in the divisi on mode. if set, undefi ned operation results are stored in mda0 and sdr0.
chapter 20 multiplier/divider user?s manual u19180ej1v0ud 645 20.3 register controlling multiplier/divider the multiplier/divider is controlled by multip lier/divider control register 0 (dmuc0). (1) multiplier/divider c ontrol register 0 (dmuc0) dmuc0 is an 8-bit register that controls the operation of the multiplier/divider. dmuc0 can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears dmuc0 to 00h. figure 20-5. format of multiplier/divider control register 0 (dmuc0) dmue dmuc0 0 0 0 0 0 0 dmusel0 stops operation starts operation dmue note 0 1 operation start/stop division mode multiplication mode dmusel0 0 1 operation mode (multiplication/division) selection address: ff42h after reset: 00h r/w symbol 4 3 2 1 0 6 <7> 5 note when dmue is set to 1, the operat ion is started. dmue is automatically cleared to 0 after the operation is complete. cautions 1. if dmue is cleared to 0 during opera tion processing (when dmue is 1), the operation result is not guaranteed. if the operation is comple ted while the clearing instruction is being executed, the operation result is guaranteed, provided that the interrupt flag is set. 2. do not change the value of dmusel0 during op eration processing (while dmue is 1). if it is changed, undefined operation results are stored in multiplication/division data register a0 (mda0) and remainder data register 0 (sdr0). 3. if dmue is cleared to 0 during operati on processing (while dmue is 1), the operation processing is stopped. to execute the operati on again, set multiplication/division data register a0 (mda0), multiplication/division data register b0 (mdb0), and multiplier/divider control register 0 (dmuc0), and star t the operation (by setting dmue to 1).
chapter 20 multiplier/divider user?s manual u19180ej1v0ud 646 20.4 operations of multiplier/divider 20.4.1 multiplication operation ? initial setting 1. set operation data to multiplicati on/division data register a0l (mda0l) and multiplication/division data register b0 (mdb0). 2. set bits 0 (dmusel0) and 7 (dmue) of multiplier/divi der control register 0 (dmuc0) to 1. operation will start. ? during operation 3. the operation will be completed when 16 peripheral hardware clocks (f prs ) have been issued after the start of the operation (intermediate data is stored in the mda0l and mda0h regist ers during operati on, and therefore the read values of these r egisters are not guaranteed). ? end of operation 4. the operation result data is stor ed in the mda0l and mda0h registers. 5. dmue is cleared to 0 (end of operation). 6. after the operation, an interrup t request signal (intdmu) is generated. ? next operation 7. to execute multiplication next , start from the initial setting in 20.4.1 multiplication operation . 8. to execute division next, start from the initial setting in 20.4.2 division operation .
chapter 20 multiplier/divider user?s manual u19180ej1v0ud 647 figure 20-6. timing chart of multiplication op eration (00dah 0093h) operation clock mda0 sdr0 mdb0 1 2 345 6 78 9a b cd e f 10 0 0 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 006d 0000 00da xxxx 00da xxxx xxxx xxxx 0049 8036 0024 c01b 005b e00d 0077 7006 003b b803 0067 5c01 007d 2e00 003e 9700 001f 4b80 000f a5c0 0007 d2e0 0003 e970 0001 f4b8 0000 fa5c 0000 7d2e 0093 xxxx internal clock dmue dmusel0 counter intdmu
chapter 20 multiplier/divider user?s manual u19180ej1v0ud 648 20.4.2 division operation ? initial setting 1. set operation data to multiplicati on/division data register a0 (mda0l a nd mda0h) and multiplication/division data register b0 (mdb0). 2. set bits 0 (dmusel0) and 7 (dmue) of multiplier/divider control register 0 (dmuc0) to 0 and 1, respectively. operation will start. ? during operation 3. the operation will be completed when 32 peripheral hardware clocks (f prs ) have been issued after the start of the operation (intermediate data is stored in the mda0l and mda0h regi sters and remainder data register 0 (sdr0) during operation, and theref ore the read values of these registers are not guaranteed). ? end of operation 4. the result data is stored in th e mda0l, mda0h, and sdr0 registers. 5. dmue is cleared to 0 (end of operation). 6. after the operation, an interrup t request signal (intdmu) is generated. ? next operation 7. to execute multiplication next , start from the initial setting in 20.4.1 multiplication operation . 8. to execute division next, start from the initial setting in 20.4.2 division operation .
chapter 20 multiplier/divider user?s manual u19180ej1v0ud 649 figure 20-7. timing chart of division operation (dcba2586h 0018h) operation clock mda0 sdr0 mdb0 12345678 19 1a 1b 1c 1d 1e 1f 20 0 0 0000 0001 0003 0006 000d 0003 0007 000e 0004 000b 0016 0014 0010 0008 0011 000b 0016 b974 4b0c dcba 2586 xxxx xxxx xxxx 72e8 a618 e5d1 2c30 cba2 6860 a744 bac1 2e89 6182 6d12 c304 ba25 8609 0c12 64d8 1824 c9b0 3049 9361 6093 26c3 c126 4d87 824c 9b0e 0499 361d 0932 6c3a 0018 xxxx internal clock dmue dmusel0 counter intdmu ?0?
user?s manual u19180ej1v0ud 650 chapter 21 power-on-clear circuit 21.1 functions of power-on-clear circuit the power-on-clear circuit (poc) is mounted onto all 78k0/fx2 microcontroller products. the power-on-clear circuit has the following functions. ? generates internal reset signal at power on. in the 1.59 v poc mode (option byte: lvistart = 0), t he reset signal is released when the supply voltage (v dd ) exceeds 1.59 v 0.15 v. in the 2.7 v/1.59 v poc m ode (option byte: lvistart = 1), the reset signal is released when the supply voltage (v dd ) exceeds 2.7 v 0.2 v. ? compares supply voltage (v dd ) and detection voltage (v poc = 1.59 v 0.15 v), generates internal reset signal when v dd < v poc . caution if an internal reset signal is generated in th e poc circuit, the reset control flag register (resf) is cleared to 00h. remark the 78k0/fx2 microcontrollers incorporates mult iple hardware functions that generate an internal reset signal. a flag that indicates the reset cause is located in the reset control flag register (resf) for when an internal reset signal is generated by the watchdog timer (wdt) or low-voltage-detector (lvi). resf is not cleared to 00h and the flag is set to 1 when an internal reset signal is generated by wdt or lvi. for details of resf, see chapter 19 reset function .
chapter 21 power-on-clear circuit user?s manual u19180ej1v0ud 651 21.2 configuration of power-on-clear circuit the block diagram of the power-on-clear circuit is shown in figure 21-1. figure 21-1. block diagram of power-on-clear circuit ? + reference voltage source internal reset signal v dd v dd 21.3 operation of power-on-clear circuit (1) in 1.59 v poc mode (option byte: lvistart = 0) ? an internal reset signal is generated on po wer application. when the supply voltage (v dd ) exceeds the detection voltage (v poc = 1.59 v 0.15 v), the reset status is released. ? the supply voltage (v dd ) and detection voltage (v poc = 1.59 v 0.15 v) are compared. when v dd < v poc , the internal reset signal is generated. it is released when v dd v poc . (2) in 2.7 v/1.59 v poc mode (option byte: lvistart = 1) ? an internal reset signal is generated on po wer application. when the supply voltage (v dd ) exceeds the detection voltage (v ddpoc = 2.7 v 0.2 v), the reset status is released. ? the supply voltage (v dd ) and detection voltage (v poc = 1.59 v 0.15 v) are compared. when v dd < v poc , the internal reset signal is generated. it is released when v dd v ddpoc . the timing of generation of the internal reset signal by the power-on-clear circuit and low-voltage detector is shown below.
chapter 21 power-on-clear circuit user?s manual u19180ej1v0ud 652 figure 21-2. timing of generation of intern al reset signal by power-on-clear circuit and low-voltage detector (1/2) (1) in 1.59 v poc mode (option byte: lvistart = 0) note 4 note 4 internal high-speed oscillation clock (f rh ) high-speed system clock (f xh ) (when x1 oscillation is selected) starting oscillation is specified by software. v poc = 1.59 v (typ.) v lvi operation stops wait for voltage stabilization (1.93 to 5.39 ms) normal operation (internal high-speed oscillation clock) note 5 operation stops reset period (oscillation stop) reset period (oscillation stop) wait for oscillation accuracy stabilization (86 to 361 s) normal operation (internal high-speed oscillation clock) note 5 starting oscillation is specified by software. starting oscillation is specified by software. cpu 0 v supply voltage (v dd ) 1.8 v note 1 wait for voltage stabilization (1.93 to 5.39 ms) normal operation (internal high-speed oscillation clock ) note 5 0.5 v/ms (min.) notes 2, 3 set lvi to be used for reset set lvi to be used for reset set lvi to be used for interrupt internal reset signal reset processing (11 to 45 s) reset processing (11 to 45 s) reset processing (11 to 45 s) notes 1. the guaranteed operation range for the sta ndard and (a) grade products is 1.8 v v dd 5.5 v, and 2.7 v v dd 5.5 v for the (a2) grade products. to set the voltage range below the guaranteed operation range to the reset stat e when the supply voltage falls, us e the reset function of the low- voltage detector, or input a low level to the reset pin. 2. with the standard and (a) grade products, if the volt age rises to 1.8 v at a rate slower than 0.5 v/ms (min.) on power application, input a low level to t he reset pin after power application and before the voltage reaches 1.8 v, or set t he 2.7 v/1.59 v poc mode by using an option byte (pocmode = 1). 3. with the (a2) grade products, if the voltage rises to 2.7 v at a rate slower than 0.75 v/ms (min.) on power application, input a low level to the reset pin after power application and before the voltage reaches 2.7 v. 4. the internal voltage stabilization time includes the o scillation accuracy stabilization time of the internal high-speed oscillation clock. 5. the internal high-speed oscillation clock and a hi gh-speed system clock or subsystem clock can be selected as the cpu clock. to use the x1 clock, use the ostc register to confirm the lapse of the oscillation stabilization time. to use the xt1 clock, use the timer function for confirmation of the lapse of the stabilization time. caution set the low-voltage detector by software after the reset status is released (see chapter 22 low-voltage detector). remark v lvi : lvi detection voltage v poc : poc detection voltage
chapter 21 power-on-clear circuit user?s manual u19180ej1v0ud 653 figure 21-2. timing of generation of intern al reset signal by power-on-clear circuit and low-voltage detector (2/2) (2) in 2.7 v / 1.59v poc mode (option byte: lvistart = 1) internal high-speed oscillation clock (f rh ) high-speed system clock (f xh ) (when x1 oscillation is selected) starting oscillation is specified by software. internal reset signal v ddpoc = 2.7 v (typ.) v poc = 1.59 v (typ.) v lvi operation stops normal operation (internal high-speed oscillation clock) note 2 normal operation (internal high-speed oscillation clock) note 2 operation stops reset period (oscillation stop) reset period (oscillation stop) normal operation (internal high-speed oscillation clock) note 2 starting oscillation is specified by software. starting oscillation is specified by software. cpu 0 v supply voltage (v dd ) 1.8 v note 1 reset processing (11 to 45 s) reset processing (11 to 45 s) reset processing (11 to 45 s) set lvi to be used for reset set lvi to be used for reset set lvi to be used for interrupt wait for oscillation accuracy stabilization (86 to 361 s) wait for oscillation accuracy stabilization (86 to 361 s) wait for oscillation accuracy stabilization (86 to 361 s) notes 1. the guaranteed operation range for the sta ndard and (a) grade products is 1.8 v v dd 5.5 v, and 2.7 v v dd 5.5 v for the (a2) grade products. to set the voltage range below the guaranteed operation range to the reset stat e when the supply voltage falls, us e the reset function of the low- voltage detector, or input a low level to the reset pin. 2. the internal high-speed oscillation clock and a hi gh-speed system clock or subsystem clock can be selected as the cpu clock. to use the x1 clock, use the ostc register to confirm the lapse of the oscillation stabilization time. to use the xt1 clock, use the timer function for confirmation of the lapse of the stabilization time. cautions 1. set the low-voltage detector by software after the reset status is released (see chapter 22 low-voltage detector). 2. a voltage oscillation stabilization time of 1.93 to 5.39 ms is required after the supply voltage reaches 1.59 v (typ.). if the supply voltage rises from 1.59 v (typ.) to 2.7 v (typ.) within 1.93 ms, the power supply oscillation stabilization time of 0 to 5.39 ms is automatically generated before reset processing. remark v lvi : lvi detection voltage v poc : poc detection voltage
chapter 21 power-on-clear circuit user?s manual u19180ej1v0ud 654 21.4 cautions for power-on-clear circuit in a system where the supply voltage (v dd ) fluctuates for a certain period in the vicinity of the poc detection voltage (v poc ), the system may be repeatedly reset and released from the reset status. in this case, the time from release of reset to the start of the oper ation of the microcontroller can be arbitrarily set by taking the following action. after releasing the reset signal, wait for the supply voltage fluctuation period of each system by means of a software counter that uses a timer, and then initialize the ports. figure 21-3. example of software processing after reset release (1/2) ? if supply voltage fluctuation is 50 ms or le ss in vicinity of poc detection voltage ; check the reset source note 2 initialize the port. note 1 reset initialization processing <1> 50 ms has passed? (tmifh1 = 1?) initialization processing <2> setting 8-bit timer h1 (to measure 50 ms) ; setting of division ratio of system clock, such as setting of timer or a/d converter yes no power-on-clear clearing wdt ;f prs = internal high-speed oscillation clock (8.4 mhz (max.)) (default) source: f prs (8.4 mhz (max.))/2 12 , where comparison value = 102: ? 50 ms timer starts (tmhe1 = 1). notes 1. if reset is generated again during this period, initialization processing <2> is not started. 2. a flowchart is shown on the next page.
chapter 21 power-on-clear circuit user?s manual u19180ej1v0ud 655 figure 21-3. example of software processing after release of reset (2/2) ? checking reset cause yes no check reset cause power-on-clear/external reset generated reset processing by watchdog timer reset processing by low-voltage detector no wdtrf of resf register = 1? lvirf of resf register = 1? yes
user?s manual u19180ej1v0ud 656 chapter 22 low-voltage detector 22.1 functions of low-voltage detector the low-voltage detector (lvi) is mounted onto all 78k0/fx2 microcontroller products. the low-voltage detector has the following functions. ? the lvi circuit compares the supply voltage (v dd ) with the detection voltage (v lvi ) or the input voltage from an external input pin (exlvi) with the detection voltsage (v exlvi = 1.21 v (typ.): fixed), and generates an internal reset or internal interrupt signal. ? the supply voltage (v dd ) or input voltage from an external input pin (exlvi) can be selected by software. ? reset or interrupt function can be selected by software. ? detection levels (16 levels note ) of supply voltage can be changed by software. ? operable in stop mode. note standard products and (a) grade products: 16 levels (a2) grade products: 10 levels the reset and interrupt signals are generated as follows depending on selection by software. selection of level detection of supply voltage (v dd ) (lvisel = 0) selection level detection of input voltage from external input pin (exlvi) (lvisel = 1) selects reset (lvimd = 1). selects interrupt (lvimd = 0). selects reset (lvimd = 1). selects interrupt (lvimd = 0). generates an internal reset signal when v dd < v lvi and releases the reset signal when v dd v lvi . generates an internal interrupt signal when v dd drops lower than v lvi (v dd < v lvi ) or when v dd becomes v lvi or higher (v dd v lvi ). generates an internal reset signal when exlvi < v exlvi and releases the reset signal when exlvi v exlvi . generates an internal interrupt signal when exlvi drops lower than v exlvi (exlvi < v exlvi ) or when exlvi becomes v exlvi or higher (exlvi v exlvi ). remark lvisel: bit 2 of low-voltage detection register (lvim) lvimd: bit 1 of lvim while the low-voltage detector is operat ing, whether the supply voltage or t he input voltage from an external input pin is more than or less than the detection level can be che cked by reading the low-voltage detection flag (lvif: bit 0 of lvim). when the low-voltage detector is used to reset, bit 0 (lvirf) of the reset control flag regi ster (resf) is set to 1 if reset occurs. for details of resf, see chapter 19 reset function .
chapter 22 low-voltage detector user?s manual u19180ej1v0ud 657 22.2 configuration of low-voltage detector the block diagram of the low-voltage detector is shown in figure 22-1. figure 22-1. block diagram of low-voltage detector lvis1 lvis0 lvion ? + reference voltage source v dd internal bus n-ch low-voltage detection level selection register (lvis) low-voltage detection register (lvim) lvis2 lvis3 lvif intlvi internal reset signal 4 lvisel exlvi/p120/ intp0 lvimd v dd low-voltage detection level selector selector selector 22.3 registers controlling low-voltage detector the low-voltage detector is contro lled by the following registers. ? low-voltage detection register (lvim) ? low-voltage detection level selection register (lvis) ? port mode register 12 (pm12)
chapter 22 low-voltage detector user?s manual u19180ej1v0ud 658 (1) low-voltage detection register (lvim) this register sets low-voltag e detection and the operation mode. this register can be set by a 1-bit or 8-bit memory manipulation instruction. the generation of a reset signal other than an lvi reset clears th is register to 00h. figure 22-2. format of low-volta ge detection register (lvim) <0> lvif <1> lvimd <2> lvisel 3 0 4 0 5 0 6 0 <7> lvion symbol lvim address: ffbeh after reset: 00h r/w note 1 lvion notes 2, 3 enables low-voltage detection operation 0 disables operation 1 enables operation lvisel note 2 voltage detection selection 0 detects level of supply voltage (v dd ) 1 detects level of input voltage from external input pin (exlvi) lvimd note 2 low-voltage detection operation m ode (interrupt/reset) selection 0 ? lvisel = 0: generates an internal interrupt signal when the supply voltage (v dd ) drops lower than the detection voltage (v lvi ) (v dd < v lvi ) or when v dd becomes v lvi or higher (v dd v lvi ). ? lvisel = 1: generates an interrupt signal when the input voltage from an external input pin (exlvi) drops lower than the detection voltage (v exlvi ) (exlvi < v exlvi ) or when exlvi becomes v exlvi or higher (exlvi v exlvi ). 1 ? lvisel = 0: generates an internal reset signal when the supply voltage (v dd ) < detection voltage (v lvi ) and releases the reset signal when v dd v lvi . ? lvisel = 1: generates an internal reset signal when the input voltage from an external input pin (exlvi) < detection voltage (v exlvi ) and releases the reset signal when exlvi v exlvi . lvif note 4 low-voltage detection flag 0 ? lvisel = 0: supply voltage (v dd ) detection voltage (v lvi ), or when operation is disabled ? lvisel = 1: input voltage from external input pin (exlvi) detection voltage (v exlvi ), or when operation is disabled 1 ? lvisel = 0: supply voltage (v dd ) < detection voltage (v lvi ) ? lvisel = 1: input voltage from external input pin (exlvi) < detection voltage (v exlvi ) notes 1. bit 0 is read-only. 2. lvion, lvimd, and lvisel are cleared to 0 in the case of a reset other than an lvi reset. these are not cleared to 0 in the case of an lvi reset. 3. when lvion is set to 1, operation of the com parator in the lvi circuit is started. use software to wait for an operation stabilization time (10 s (min.)) from when lvion is set to 1 until operation is stabilized. after operation has stabilized, the external input of 200 s (min.) (minimum pulse width: 200 s (min.)) is required from when a state below lvi detection voltage has been entered, until lvif is set (1). 4. the value of lvif is output as the interru pt request signal intlvi when lvion = 1 and lvimd = 0.
chapter 22 low-voltage detector user?s manual u19180ej1v0ud 659 cautions 1. to stop lvi, follow either of the procedures below. ? when using 8-bit memory manipulation instruction: write 00h to lvim. ? when using 1-bit memory manipulation instruction: clear lvion to 0. 2. input voltage from external input pin (exlvi) must be exlvi < v dd . 3. when using lvi as an interrupt, if lvio n is cleared (0) in a state below the lvi detection voltage, an intlvi signal is generate d and lviif becomes 1. (2) low-voltage detection level selection register (lvis) this register selects the low-voltage detection level. this register can be set by a 1-bit or 8-bit memory manipulation instruction. the generation of a reset signal other than an lvi reset clears th is register to 00h. figure 22-3. format of low-voltage dete ction level selection register (lvis) 0 lvis0 1 lvis1 2 lvis2 3 lvis3 4 0 5 0 6 0 7 0 symbol lvis address: ffbfh after reset: 00h note 1 r/w lvis3 lvis2 lvis1 lvis0 detection level 0 0 0 0 v lvi0 (4.24 v 0.1 v) 0 0 0 1 v lvi1 (4.09 v 0.1 v) 0 0 1 0 v lvi2 (3.93 v 0.1 v) 0 0 1 1 v lvi3 (3.78 v 0.1 v) 0 1 0 0 v lvi4 (3.62 v 0.1 v) 0 1 0 1 v lvi5 (3.47 v 0.1 v) 0 1 1 0 v lvi6 (3.32 v 0.1 v) 0 1 1 1 v lvi7 (3.16 v 0.1 v) 1 0 0 0 v lvi8 (3.01 v 0.1 v) 1 0 0 1 v lvi9 (2.85 v 0.1 v) 1 0 1 0 v lvi10 (2.70 v 0.1 v) note 2 1 0 1 1 v lvi11 (2.55 v 0.1 v) note 2 1 1 0 0 v lvi12 (2.39 v 0.1 v) note 2 1 1 0 1 v lvi13 (2.24 v 0.1 v) note 2 1 1 1 0 v lvi14 (2.08 v 0.1 v) note 2 1 1 1 1 v lvi15 (1.93 v 0.1 v) note 2 notes 1. the value of lvis is not reset but retained as is, upon a reset by lvi. it is cleared to 00h upon other resets. 2. do not set v lvi10 to v lvi15 for (a2) grade products. cautions 1. be sure to clear bits 4 to 7 to 0. 2. do not change the value of lvis during lvi operation. 3. when an input voltage from the externa l input pin (exlvi) is detected, the detection voltage (v exlvi = 1.21 v (typ.)) is fixed. therefor e, setting of lvis is not necessary.
chapter 22 low-voltage detector user?s manual u19180ej1v0ud 660 (3) port mode register 12 (pm12) when using the p120/exlvi/intp0 pin for external low-volt age detection potential input, set pm120 to 1. at this time, the output latch of p120 may be 0 or 1. pm12 can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation sets pm12 to ffh. figure 22-4. format of port mode register 12 (pm12) 0 pm120 1 pm121 2 pm122 3 pm123 4 pm124 5 1 6 1 7 1 symbol pm12 address: ff2ch after reset: ffh r/w pm12n p12n pin i/o mode selection (n = 0 to 4) 0 output mode (output buffer on) 1 input mode (output buffer off) 22.4 operation of low-voltage detector the low-voltage detector can be us ed in the following two modes. (1) used as reset (lvimd = 1) ? if lvisel = 0, compares the supply voltage (v dd ) and detection voltage (v lvi ), generates an internal reset signal when v dd < v lvi , and releases internal reset when v dd v lvi . ? if lvisel = 1, compares the input voltage from external input pin (exlvi) and detection voltage (v exlvi = 1.21 v (typ.)), generates an internal reset signal when exlvi < v exlvi , and releases internal reset when exlvi v exlvi . (2) used as interrupt (lvimd = 0) ? if lvisel = 0, compares the supply voltage (v dd ) and detection voltage (v lvi ). when v dd drops lower than v lvi (v dd < v lvi ) or when v dd becomes v lvi or higher (v dd v lvi ), generates an interrupt signal (intlvi). ? if lvisel = 1, compares the input voltage from external input pin (exlvi) and detection voltage (v exlvi = 1.21 v (typ.)). when exlvi drops lower than v exlvi (exlvi < v exlvi ) or when exlvi becomes v exlvi or higher (exlvi v exlvi ), generates an interrupt signal (intlvi). while the low-voltage detector is operat ing, whether the supply voltage or t he input voltage from an external input pin is more than or less than the detection level can be che cked by reading the low-voltage detection flag (lvif: bit 0 of lvim). remark lvimd: bit 1 of low-voltage detection register (lvim) lvisel: bit 2 of lvim
chapter 22 low-voltage detector user?s manual u19180ej1v0ud 661 22.4.1 when used as reset (1) when detecting level of supply voltage (v dd ) ? when starting operation <1> mask the lvi interrupt (lvimk = 1). <2> clear bit 2 (lvisel) of the low-voltage detection r egister (lvim) to 0 (detects level of supply voltage (v dd )) (default value). <3> set the detection voltage using bits 3 to 0 (lvis3 to lvis0) of the low-voltage detection level selection register (lvis). <4> set bit 7 (lvion) of lvim to 1 (enables lvi operation). <5> use software to wait for an operation stabilization time (10 s (min.)) and minimum pulse width. <6> wait until it is checked that (supply voltage (v dd ) detection voltage (v lvi )) by bit 0 (lvif) of lvim. <7> set bit 1 (lvimd) of lvim to 1 (generates reset when the level is detected). figure 22-5 shows the timing of the internal reset signal generated by the low-volt age detector. the numbers in this timing chart correspond to <1> to <7> above. cautions 1. <1> must always be executed. when lvimk = 0, an interrupt may occur immediately after the processing in <4>. 2. if supply voltage (v dd ) detection voltage (v lvi ) when lvimd is set to 1, an internal reset signal is not generated. ? when stopping operation either of the following pr ocedures must be executed. ? when using 8-bit memory manipulation instruction: write 00h to lvim. ? when using 1-bit memory manipulation instruction: clear lvimd to 0 and then lvion to 0.
chapter 22 low-voltage detector user?s manual u19180ej1v0ud 662 figure 22-5. timing of low-voltage dete ctor internal reset signal generation (detects level of supply voltage (v dd )) (1/2) (1) in 1.59 v poc mode setup (option byte: lvistart = 0) supply voltage (v dd ) <3> <1> time lvimk flag (set by software lvif flag lvirf flag note 3 note2 lvi reset signal poc reset signal internalreset signal cleared by software not cleared cleared by software <4> <7> clear clear clear <5>wait time lvion flag (set by software) lvimd flag (set by software) h note1 l lvisel flag (set by software) <6> <2> v lvi v poc = 1.59 v (typ.) not cleared not cleared not cleared notes 1. the lvimk flag is set to ?1? by reset signal generation. 2. the lvif flag may be set (1). 3. lvirf is bit 0 of the reset control flag re gister (resf). for details of resf, see chapter 19 reset function . remark <1> to <7> in figure 22-5 above correspond to <1> to <7> in the description of ?when starting operation? in 22.4.1 (1) when detecting level of supply voltage (v dd ) .
chapter 22 low-voltage detector user?s manual u19180ej1v0ud 663 figure 22-5. timing of low-voltage dete ctor internal reset signal generation (detects level of supply voltage (v dd )) (2/2) (2) in 2.7/1.59 v poc mode setup (option byte: lvistart = 1) supply voltage (v dd ) v lvi <3> <1> time lvimk flag (set by software) lvif flag lvirf flag note 3 note 2 lvi reset signal poc reset signal internal reset signal cleared by software not cleared not cleared not cleared not cleared cleared by software <4> <7> clear clear clear <5> wait time lvion flag (set by software) lvimd flag (set by software) h note 1 l lvisel flag (set by software) <6> <2> 2.7 v (typ.) v poc = 1.59 v (typ.) notes 1. the lvimk flag is set to ?1? by reset signal generation. 2. the lvif flag may be set (1). 3. lvirf is bit 0 of the reset control flag re gister (resf). for details of resf, see chapter 19 reset function . remark <1> to <7> in figure 22-5 above correspond to <1> to <7> in the description of ?when starting operation? in 22.4.1 (1) when detecting level of supply voltage (v dd ) .
chapter 22 low-voltage detector user?s manual u19180ej1v0ud 664 (2) when detecting level of input vo ltage from external input pin (exlvi) ? when starting operation <1> mask the lvi interrupt (lvimk = 1). <2> set bit 2 (lvisel) of the low-voltage detection regist er (lvim) to 1 (detects level of input voltage from external input pin (exlvi)). <3> set bit 7 (lvion) of lvim to 1 (enables lvi operation). <4> use software to wait for an operation stabilization time (10 s (min.)) and minimum pulse width. <5> wait until it is checked that (input voltage from external input pin (exlvi) detection voltage (v exlvi = 1.21 v (typ.))) by bit 0 (lvif) of lvim. <6> set bit 1 (lvimd) of lvim to 1 (generates reset signal when the level is detected). figure 22-6 shows the timing of the internal reset signal generated by the low-volt age detector. the numbers in this timing chart correspond to <1> to <6> above. cautions 1. <1> must always be executed. when lvimk = 0, an interrupt may occur immediately after the processing in <3>. 2. if input voltage from external input pin (exlvi) detection voltage (v exlvi = 1.21 v (typ.)) when lvimd is set to 1, an in ternal reset signal is not generated. 3. input voltage from external input pin (exlvi) must be exlvi < v dd . ? when stopping operation either of the following pr ocedures must be executed. ? when using 8-bit memory manipulation instruction: write 00h to lvim. ? when using 1-bit memory manipulation instruction: clear lvimd to 0 and then lvion to 0.
chapter 22 low-voltage detector user?s manual u19180ej1v0ud 665 figure 22-6. timing of low-voltage dete ctor internal reset signal generation (detects level of input voltage fr om external input pin (exlvi)) input voltage from external input pin (exlvi) lvi detection voltage (v exlvi ) <1> time lvimk flag (set by software) lvif flag lvirf flag note 3 note 2 lvi reset signal internal reset signal cleared by software not cleared not cleared not cleared not cleared cleared by software <3> <6> lvion flag (set by software) lvimd flag (set by software) h note 1 lvisel flag (set by software) <5> <2> not cleared not cleared <4> wait time not cleared not cleared not cleared notes 1. the lvimk flag is set to ?1? by reset signal generation. 2. the lvif flag may be set (1). 3. lvirf is bit 0 of the reset control flag re gister (resf). for details of resf, see chapter 19 reset function . remark <1> to <6> in figure 22-6 above correspond to <1> to <6> in the description of ? when starting operation? in 22.4.1 (2) when detecting level of input voltage from external input pin (exlvi) .
chapter 22 low-voltage detector user?s manual u19180ej1v0ud 666 22.4.2 when used as interrupt (1) when detecting level of supply voltage (v dd ) ? when starting operation <1> mask the lvi interrupt (lvimk = 1). <2> clear bit 2 (lvisel) of the low-voltage detection r egister (lvim) to 0 (detects level of supply voltage (v dd )) (default value). <3> set the detection voltage using bits 3 to 0 (lvis3 to lvis0) of the low-voltage detection level selection register (lvis). <4> set bit 7 (lvion) of lvim to 1 (enables lvi operation). <5> use software to wait for an operation stabilization time (10 s (max.)) and minimum pulse width. <6> confirm that ?supply voltage (v dd ) detection voltage (v lvi )? when detecting the falling edge of v dd , or ?supply voltage (v dd ) < detection voltage (v lvi )? when detecting the rising edge of v dd , at bit 0 (lvif) of lvim. <7> clear the interrupt request flag of lvi (lviif) to 0. <8> release the interrupt mask flag of lvi (lvimk). <9> clear bit 1 (lvimd) of lvim to 0 (generates interr upt signal when the level is detected) (default value). <10> execute the ei instruction (w hen vector interrupts are used). figure 22-7 shows the timing of the interrupt signal ge nerated by the low-voltage detector. the numbers in this timing chart correspond to <1> to <9> above. ? when stopping operation either of the following pr ocedures must be executed. ? when using 8-bit memory manipulation instruction: write 00h to lvim. ? when using 1-bit memory manipulation instruction: clear lvion to 0.
chapter 22 low-voltage detector user?s manual u19180ej1v0ud 667 figure 22-7. timing of low-voltage de tector interrupt signal generation (detects level of supply voltage (v dd )) (1/2) (1) in 1.59 v poc mode setup (option byte: lvistart = 0) supply voltage (v dd ) time <1> note 1 <8> cleared by software lvimk flag (set by software) lvif flag intlvi lviif flag internal reset signal <4> <6> <7> cleared by software <5> wait time lvion flag (set by software) note 2 note 2 <3> l lvisel flag (set by software) <2> lvimd flag (set by software) l <9> v lvi v poc = 1.59 v (typ.) note 2 note 3 note 3 notes 1. the lvimk flag is set to ?1? by reset signal generation. 2. the interrupt request signal (intlvi) is generat ed and the lvif and lviif flags may be set (1). 3. if lvion is cleared (0) in state below the lvi det ection voltage, an intlvi signal is generated and lviif becomes 1. remark <1> to <9> in figure 22-7 above correspond to <1> to <9> in the description of ?when starting operation? in 22.4.2 (1) when detecting level of supply voltage (v dd ) .
chapter 22 low-voltage detector user?s manual u19180ej1v0ud 668 figure 22-7. timing of low-voltage de tector interrupt signal generation (detects level of supply voltage (v dd )) (2/2) (2) in 2.7/1.59 v poc mode setup (option byte: lvistart = 1) supply voltage (v dd ) time <1> note 1 <8> cleared by software lvimk flag (set by software) lvif flag intlvi lviif flag internal reset signal <4> <6> <7> cleared by software <5> wait time lvion flag (set by software) note 2 note 2 <3> l lvisel flag (set by software) <2> lvimd flag (set by software) l <9> v lvi 2.7 v(typ.) v poc = 1.59 v (typ.) note 2 note 3 note 3 notes 1. the lvimk flag is set to ?1? by reset signal generation. 2. the interrupt request signal (intlvi) is generated and the lvif and lviif flags may be set (1). 3. if lvion is cleared (0) in state below the lvi det ection voltage, an intlvi signal is generated and lviif becomes 1. remark <1> to <9> in figure 22-7 above correspond to <1> to <9> in the description of ?when starting operation? in 22.4.2 (1) when detecting level of supply voltage (v dd ) .
chapter 22 low-voltage detector user?s manual u19180ej1v0ud 669 (2) when detecting level of input vo ltage from external input pin (exlvi) ? when starting operation <1> mask the lvi interrupt (lvimk = 1). <2> set bit 2 (lvisel) of the low-voltage detection regist er (lvim) to 1 (detects level of input voltage from external input pin (exlvi)). <3> set bit 7 (lvion) of lvim to 1 (enables lvi operation). <4> use software to wait for an operation stabilization time (10 s (max.)) and minimum pulse width. <5> confirm that ?input voltage from external input pin (exlvi) detection voltage (v exlvi = 1.21 v (typ.)? when detecting the falling edge of exlvi, or ?input vo ltage from external input pin (exlvi) < detection voltage (v exlvi = 1.21 v (typ.))? when detecting the rising e dge of exlvi, at bit 0 (lvif) of lvim. <6> clear the interrupt request flag of lvi (lviif) to 0. <7> release the interrupt mask flag of lvi (lvimk). <8> clear bit 1 (lvimd) of lvim to 0 (generates interr upt signal when the level is detected) (default value). <9> execute the ei instruction (w hen vector interrupts are used). figure 22-8 shows the timing of the interrupt signal ge nerated by the low-voltage detector. the numbers in this timing chart correspond to <1> to <8> above. caution input voltage from external i nput pin (exlvi) must be exlvi < v dd . ? when stopping operation either of the following pr ocedures must be executed. ? when using 8-bit memory manipulation instruction: write 00h to lvim. ? when using 1-bit memory manipulation instruction: clear lvion to 0.
chapter 22 low-voltage detector user?s manual u19180ej1v0ud 670 figure 22-8. timing of low-voltage detector interrupt signal generation (detects level of input voltage fr om external input pin (exlvi)) input voltage from external input pin (exlvi) v exlvi time <1> note 1 <7> cleared by software lvimk flag (set by software) lvif flag intlvi lviif flag <3> <5> <6> cleared by software <4> wait time lvion flag (set by software) note 2 note 2 lvisel flag (set by software) <2> lvimd flag (set by software) l <8> note 2 note 3 note 3 notes 1. the lvimk flag is set to ?1? by reset signal generation. 2. the interrupt request signal (intlvi) is generated and the lvif and lviif flags may be set (1). 3. if lvion is cleared (0) in state below the lvi det ection voltage, an intlvi signal is generated and lviif becomes 1. remark <1> to <8> in figure 22-8 above correspond to <1> to <8> in the description of ?when starting operation? in 22.4.2 (2) when detecting level of input voltage from external input pin (exlvi) .
chapter 22 low-voltage detector user?s manual u19180ej1v0ud 671 22.5 cautions for low-voltage detector in a system where the supply voltage (v dd ) fluctuates for a certain period in t he vicinity of the lvi detection voltage (v lvi ), the operation is as follows depending on how the low-voltage detector is used. (1) when used as reset the system may be repeatedly reset and released from the reset status. in this case, the time from release of reset to the start of the operation of the microcontroller can be arbitrarily set by taking action (1) below. (2) when used as interrupt interrupt requests may be frequently generated. take (b) of action (2) below. (1) when used as reset after releasing the reset signal, wait for the supply vo ltage fluctuation period of each system by means of a software counter that uses a timer, and then initialize the ports (see figure 22-9 ). (2) when used as interrupt (a) confirm that ?supply voltage (v dd ) detection voltage (v lvi )? when detecting the falling edge of v dd , or ?supply voltage (v dd ) < detection voltage (v lvi )? when detecting the rising edge of v dd , in the servicing routine of the lvi interrupt by using bit 0 (l vif) of the low-voltage detection regi ster (lvim). clear bit 0 (lviif) of interrupt request flag regi ster 0l (if0l) to 0. (b) in a system where the supply voltage fluctuation period is long in the vicinity of t he lvi detection voltage, wait for the supply voltage fluctuation per iod, confirm that ?supply voltage (v dd ) detection voltage (v lvi )? when detecting the falling edge of v dd , or ?supply voltage (v dd ) < detection voltage (v lvi )? when detecting the rising edge of v dd , using the lvif flag, and clear the lviif flag to 0. remark if bit 2 (lvisel) of the low voltage detection regist er (lvim) is set to ?1?, the meanings of the above words change as follows. ? supply voltage (v dd ) input voltage from external input pin (exlvi) ? detection voltage (v lvi ) detection voltage (v exlvi = 1.21 v)
chapter 22 low-voltage detector user?s manual u19180ej1v0ud 672 figure 22-9. example of software processing after reset release (1/2) ? if supply voltage fluctuation is 50 ms or less in vicinity of lvi detection voltage ; check the reset source note initialize the port. reset initialization processing <1> 50 ms have passed? (tmifh1 = 1?) initialization processing <2> setting 8-bit timer h1 (to measure 50 ms) ; setting of division ratio of system clock, such as setting of timer or a/d converter yes no clearing wdt detection voltage or higher (lvif = 0?) yes restarting timer h1 (tmhe1 = 0 tmhe1 = 1) no ; the timer counter is cleared and the timer is started. lvi reset ;f prs = internal high-speed oscillation clock (8.4 mhz (max.)) (default) source: f prs (8.4 mhz (max.))/2 12 , where comparison value = 102: ? 50 ms timer starts (tmhe1 = 1). note a flowchart is shown on the next page.
chapter 22 low-voltage detector user?s manual u19180ej1v0ud 673 figure 22-9. example of software processing after reset release (2/2) ? checking reset cause yes: reset generation by lvi no: reset generation other than by lvi set lvi (set lvim and lvis registers) check reset source lvion of lvim register = 1? end
user?s manual u19180ej1v0ud 674 chapter 23 option byte 23.1 functions of option bytes the flash memory at 0080h to 0084h of the 78k0/fx2 mi crocontrollers are an option byte area. when power is turned on or when the device is restar ted from the reset status, the device automatically re ferences the option bytes and sets specified functions. when using the product, be sure to set the following functions by using the option bytes. when the boot swap operation is used during self-programming, 0080h to 0084h are switched to 1080h to 1084h. therefore, set values that are the same as thos e of 0080h to 0084h to 1080h to 1084h in advance. caution be sure to set 00h to 0082h and 0083h (0082h/1082h and 0083h/1 083h when the boot swap function is used). (1) 0080h/1080h { internal low-speed oscillator operation ? can be stopped by software ? cannot be stopped { watchdog timer interval time setting { watchdog timer counter operation ? enabled counter operation ? disabled counter operation { watchdog timer window open period setting caution set a value that is the same as that of 0080h to 1080h because 0080h and 1080h are switched during the boot swap operation. (2) 0081h/1081h { selecting poc mode ? during 2.7 v/1.59 v poc mo de operation (lvistart = 1) the device is in the reset state upon power application and until the supply voltage r eaches 2.7 v (typ.). it is released from the reset state when the voltage exceeds 2.7 v (typ.). after that , poc is not detected at 2.7 v but is detect ed at 1.59 v (typ.). with (a) grade products, if the supply voltage rises to 1. 8 v after power application at a pace slower than 0.5 v/ms (min.), use of the 2.7 v/ 1.59 v poc mode is recommended. ? during 1.59 v poc mode operation (lvistart = 0) the device is in the reset state upon power application and until the supply voltage reaches 1.59 v (typ.). it is released from the reset state when the voltage exceeds 1.59 v (typ.). after that, poc is detected at 1.59 v (typ.), in the same mann er as on power application. caution lvistart can only be written by using a dedicated flash memory programmer. it cannot be set during self-programming or boot swap operation during self-programming (at this time, 1.59 v poc mode (default) is set). however, because the value of 1081h is copied to 0081h during the boot swap operation, it is recommended to set a value that is the same as that of 0081h to 1081h when the boot swap function is used.
chapter 23 option byte user?s manual u19180ej1v0ud 675 (3) 0084h/1084h { on-chip debug operation control ? disabling on-chip debug operation ? enabling on-chip debug operation and erasing data of th e flash memory in case authentication of the on- chip debug security id fails ? enabling on-chip debug operation and not erasing data of the flash memory even in case authentication of the on-chip debug security id fails caution to use the on-chip debug function, set 02h or 03h to 0084h. set a value that is the same as that of 0084h to 1084h because 0084h and 1084h are switched during the boot operation.
chapter 23 option byte user?s manual u19180ej1v0ud 676 23.2 format of option byte the format of the option byte is shown below. figure 23-1. format of option byte (1/2) address: 0080h/1080h note 7 6 5 4 3 2 1 0 0 window1 window0 wdton wdcs2 wdcs1 wdcs0 lsrosc window1 window0 watchdog timer window open period 0 0 25% 0 1 50% 1 0 75% 1 1 100% wdton operation control of watchdog timer counter/illegal access detection 0 counter operation disabled (counting stopped a fter reset), illegal access detection operation disabled 1 counter operation enabled (counting started a fter reset), illegal access detection operation enabled wdcs2 wdcs1 wdcs0 watc hdog timer overflow time 0 0 0 2 10 /f rl (3.88 ms) 0 0 1 2 11 /f rl (7.76 ms) 0 1 0 2 12 /f rl (15.52 ms) 0 1 1 2 13 /f rl (31.03 ms) 1 0 0 2 14 /f rl (62.06 ms) 1 0 1 2 15 /f rl (124.12 ms) 1 1 0 2 16 /f rl (248.24 ms) 1 1 1 2 17 /f rl (496.48 ms) lsrosc internal low-speed oscillator operation 0 can be stopped by software (stopped when 1 is written to bit 0 (lsrstop) of rcm register) 1 cannot be stopped (not stopped even if 1 is written to lsrstop bit) note set a value that is the same as that of 0080h to 1080h because 0080h and 1080h are switched during the boot swap operation. cautions 1. the combination of wdcs2 = w dcs1 = wdcs0 = 0 and window1 = window0 = 0 is prohibited. 2. the watchdog timer continues its operation during self-programming and eeprom emulation of the flash memory. during pr ocessing, the interrupt acknowledge time is delayed. set the overflow time and window size taking this delay into consideration. 3. if lsrosc = 0 (oscillation can be stopped by software), the count clock is not supplied to the watchdog timer in the halt and stop modes, regardless of the setting of bit 0 (lsrstop) of the internal oscillator m ode register (rcm). when 8-bit timer h1 operates with the internal low-speed oscillation cl ock, the count clock is supplied to 8-bit timer h1 even in the halt/stop mode. 4. be sure to clear bit 7 to 0. remarks 1. f rl : internal low-speed oscillation clock frequency 2. ( ): f rl = 264 khz (max.)
chapter 23 option byte user?s manual u19180ej1v0ud 677 figure 23-1. format of option byte (2/2) address: 0081h/1081h notes 1, 2 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 lvistart lvistart poc mode selection 0 1.59 v poc mode (default) 1 2.7 v/1.59 v poc mode notes 1. lvistart can only be written by using a dedicated flash memory programmer. it cannot be set during self-programming or boot swap operation during self -programming (at this time, 1.59 v poc mode (default) is set). however, because the value of 1081h is copied to 0081h during the boot swap operation, it is recommended to set a value that is the same as that of 0081h to 1081h when the boot swap function is used. 2. to change the setting for the poc mode, set the va lue to 0081h again after batch erasure (chip erasure) of the flash memory. the setting cannot be changed after t he memory of the specified block is erased. caution be sure to clear bits 7 to 1 to ?0?. address: 0082h/1082h, 0083h/1083h note 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 0 note be sure to set 00h to 0082h and 0083h, as these addresses are reserved areas. also set 00h to 1082h and 1083h because 0082h and 0083h are switched with 1082h and 1083h when the boot swap operation is used. address: 0084h/1084h note 7 6 5 4 3 2 1 0 0 0 0 0 0 0 ocden1 ocden0 ocden1 ocden0 on-chip debug operation control 0 0 operation disabled 0 1 setting prohibited 1 0 operation enabled. does not erase data of the flash memory in case authentication of the on-chip debug security id fails. 1 1 operation enabled. erases data of the flash memory in case authentication of the on-chip debug security id fails. note to use the on-chip debug function, set 02h or 03h to 0084h . set a value that is the same as that of 0084h to 1084h because 0084h and 1084h are switched during the boot swap operation. remark for the on-chip debug security id, see chapter 25 on-chip debug function .
chapter 23 option byte user?s manual u19180ej1v0ud 678 here is an example of description of the software for setting the option bytes. opt cseg at 0080h option: db 30h ; enables watchdog timer operation (illegal access detection operation), ; window open period of watchdog timer: 50%, ; overflow time of watchdog timer: 2 10 /f rl , ; internal low-speed oscillator can be stopped by software. db 00h ; 1.59 v poc mode db 00h ; reserved area db 00h ; reserved area db 00h ; on-chip debug operation disabled remark referencing of the option byte is performed during reset processing. for the reset processing timing, see chapter 19 reset function .
user?s manual u19180ej1v0ud 679 chapter 24 flash memory the 78k0/fx2 microcontrollers incorporates the flash me mory to which a program can be written, erased, and overwritten while mounted on the board. 24.1 internal memory size switching register the internal memory capacity can be selected using t he internal memory size sw itching register (ims). ims is set by an 8-bit memory manipulation instruction. reset signal generation sets ims to cfh. caution be sure to set each product to the values shown in table 24-1 afte r a reset release. figure 24-1. format of internal memory size switching register (ims) address: fff0h after reset: cfh r/w symbol 7 6 5 4 3 2 1 0 ims ram2 ram1 ram0 0 rom3 rom2 rom1 rom0 ram2 ram1 ram0 internal high-speed ram capacity selection 1 1 0 1024 bytes other than above setting prohibited rom3 rom2 rom1 rom0 inte rnal rom capacity selection 1 0 0 0 32 kb 1 1 0 0 48 kb 1 1 1 1 60 kb other than above setting prohibited caution to set the memory size, set ims and then ixs. set the memory size so that the internal rom and internal expansion ram areas do not overlap. table 24-1. internal memory size switching register settings 78k0/fx2 microcontrollers ims setting pd78f0881a, 78f0884a c8h pd78f0882a, 78f0885a, 78f0887a cch pd78f0883a, 78f0886a, 78f0888a, 78f0891a cfh pd78f0889a, 78f0892a, 78f0894a cch note pd78f0890a, 78f0893a, 78f0895a cch note note the pd78f0889a, 78f0890a, 78f0892a to 78f0895a have internal roms of 96 kb and 128 kb, respectively. however, the set values of the ims of these devices is the same as those for the 48 kb produc t because banks are used. for how to set the banks, see chapter 4 memory bank select function ( pd78f0889a, 78f0890a, 78f0892a to 78f0895a only) .
chapter 24 flash memory user?s manual u19180ej1v0ud 680 24.2 internal expansion ram size switching register the internal expansion ram capacity can be selected using the internal expansion ram size switching register (ixs). ixs is set by an 8-bit memo ry manipulation instruction. reset signal generation sets ixs to 0ch. caution be sure to set each product to the valu es shown in table 24-2 after a reset release. figure 24-2. format of internal expansion ram size switching register (ixs) address: fff4h after reset: 0ch r/w symbol 7 6 5 4 3 2 1 0 ixs 0 0 0 ixram4 ixram3 ixram2 ixram1 ixram0 ixram4 ixram3 ixram2 ixram1 ixram0 internal expansion ram capacity selection 0 1 0 1 0 1024 bytes 0 1 0 0 0 2048 bytes 0 0 1 0 0 4096 bytes 0 0 0 0 0 6144 bytes other than above setting prohibited caution to set memory size, set ims and then ixs. set memory size so that the internal rom area and internal expansion ram area do not overlap. table 24-2. internal expansion ram size switching register settings 78k0/fx2 microcontrollers ixs setting pd78f0881a, 78f0884a 0ah pd78f0882a, 78f0885a, 78f0887a 08h pd78f0883a, 78f0886a, 78f0888a, 78f0891a 08h pd78f0889a, 78f0892a, 78f0894a 04h pd78f0890a, 78f0893a, 78f0895a 00h
chapter 24 flash memory user?s manual u19180ej1v0ud 681 24.3 writing with flash memory programmer data can be written to the flash memory on-board or o ff-board, by using a dedicated flash memory programmer. (1) on-board programming the contents of the flash memory can be rewritten a fter the 78k0/fx2 microcontrollers have been mounted on the target system. the connectors t hat connect the dedicated flash memory programmer must be mounted on the target system. (2) off-board programming data can be written to the flash memory with a dedi cated program adapter (fa se ries) before the 78k0/fx2 microcontrollers are mounted on the target system. remark the fa series is a product of na ito densei machida mfg. co., ltd. table 24-3. wiring between 78k0/fc2 an d dedicated flash memory programmer ( pd78f0881a, 78f0882a, 78f0883a) pin configuration of dedicated flash memory programmer with csi10 with uart60 signal name i/o pin function pin name pin no. pin name pin no. si/rxd input receive signal so10/p12 29 txd60/p13 28 so/txd output transmit signal si10/rxd61/p11 30 rxd60/p14 27 sck output transfer clock sck10/txd61/p10 31 ? ? clk output clock to 78k0/fc2 ? note 1 ? note 2 note 2 /reset output reset signal reset 3 reset 3 flmd0 output mode signal flmd0 6 flmd0 6 v dd 11 v dd 11 ev dd 11 ev dd 11 v dd i/o v dd voltage generation/ power monitoring av ref 32 av ref 32 v ss 10 v ss 10 ev ss 10 ev ss 10 gnd ? ground av ss 33 av ss 33 notes 1. only the internal high-speed oscillation clock (f rh ) can be used when csi10 is used. 2. only the x1 clock (f x ) or external main system clock (f exclk ) can be used when uart60 is used. when using the clock output of t he dedicated flash memory programmer, pin connection varies depending on the type of the dedicated flash memory programmer used. ? pg-fp5, fl-pr5, pg-fp4, fl-pr4: connect clk of the programmer to exclk/x2/p122 (pin 7).
chapter 24 flash memory user?s manual u19180ej1v0ud 682 examples of the recommended connection when using the adapter for flash memory writing are shown below. figure 24-3. example of wiring ad apter for flash memory writing in 3-wire serial i/o (csi10) mode ( pd78f0881a, 78f0882a, 78f0883a of 78k0/fc2) gnd v dd v dd2 (lv dd ) v dd (2.7 to 5.5 v) gnd 1 2 3 4 5 6 7 8 9 10 11 33 32 31 30 29 28 27 26 25 24 23 44 43 42 41 40 39 38 37 36 35 34 12 13 14 15 16 17 18 19 20 21 22 si so sck clk /reset flmd0 writer interface
chapter 24 flash memory user?s manual u19180ej1v0ud 683 figure 23-4. example of wiring adapter for flash memory writing in uart (uart60) mode ( pd78f0881a, 78f0882a, 78f0883a of 78k0/fc2) gnd v dd v dd2 (lv dd ) v dd (2.7 to 5.5 v) gnd 1 2 3 4 5 6 7 8 9 10 11 33 32 31 30 29 28 27 26 25 24 23 44 43 42 41 40 39 38 37 36 35 34 12 13 14 15 16 17 18 19 20 21 22 si so sck clk /reset flmd0 writer interface note note note the above figure illustrates an example of wiring when using the clock output from the pg-fp5 or fl-pr5 or pg-fp4 or fl-pr4.
chapter 24 flash memory user?s manual u19180ej1v0ud 684 table 23-4. wiring between 78k0/fc2 an d dedicated flash memory programmer ( pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a) pin configuration of dedicated flash memory programmer with csi10 with uart60 signal name i/o pin function pin name pin no. pin name pin no. si/rxd input receive signal so10/p12 32 txd60/p13 31 so/txd output transmit signal si10/rxd61/p11 33 rxd60/p14 30 sck output transfer clock sck10/txd61/p10 34 ? ? clk output clock to 78k0/fc2 ? note 1 ? note 2 note 2 /reset output reset signal reset 4 reset 4 flmd0 output mode signal flmd0 7 flmd0 7 v dd 12 v dd 12 ev dd 12 ev dd 12 v dd i/o v dd voltage generation/ power monitoring av ref 35 av ref 35 v ss 11 v ss 11 ev ss 11 ev ss 11 gnd ? ground av ss 36 av ss 36 notes 1. only the internal high-speed oscillation clock (f rh ) can be used when csi10 is used. 2. only the x1 clock (f x ) or external main system clock (f exclk ) can be used when uart60 is used. when using the clock output of t he dedicated flash memory programmer, pin connection varies depending on the type of the dedicated flash memory programmer used. ? pg-fp5, fl-pr5, pg-fp4, fl-pr4: connect clk of the programmer to exclk/x2/p122 (pin 8).
chapter 24 flash memory user?s manual u19180ej1v0ud 685 examples of the recommended connection when using the adapter for flash memory writing are shown below. figure 24-5. example of wiring ad apter for flash memory writing in 3-wire serial i/o (csi10) mode ( pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of 78k0/fc2) gnd v dd v dd2 (lv dd ) v dd (2.7 to 5.5 v) gnd 1 2 3 4 5 6 7 8 9 10 11 12 36 35 34 33 32 31 30 29 28 27 26 25 48 47 46 45 44 43 42 41 40 39 38 37 13 14 15 16 17 18 19 20 21 22 23 24 si so sck clk /reset flmd0 writer interface
chapter 24 flash memory user?s manual u19180ej1v0ud 686 figure 24-6. example of wiring adapter for flash memory writing in uart (uart60) mode ( pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of 78k0/fc2) gnd v dd v dd2 (lv dd ) v dd (2.7 to 5.5 v) gnd 1 2 3 4 5 6 7 8 9 10 11 12 36 35 34 33 32 31 30 29 28 27 26 25 48 47 46 45 44 43 42 41 40 39 38 37 13 14 15 16 17 18 19 20 21 22 23 24 si so sck clk /reset flmd0 writer interface note note note the above figure illustrates an example of wiring when using the clock output from the pg-fp5 or fl-pr5 or pg-fp4 or fl-pr4.
chapter 24 flash memory user?s manual u19180ej1v0ud 687 table 24-5. wiring between 78k0/fe2 an d dedicated flash memory programmer pin configuration of dedicated flash memory programmer with csi10 with uart60 signal name i/o pin function pin name pin no. pin name pin no. si/rxd input receive signal so10/p12 44 txd60/p13 43 so/txd output transmit signal si10/rxd61/p11 45 rxd60/p14 42 sck output transfer clock sck10/txd61/p10 46 ? ? clk output clock to 78k0/fe2 ? note 1 ? note 2 note 2 /reset output reset signal reset 6 reset 6 flmd0 output mode signal flmd0 9 flmd0 9 v dd 15 v dd 15 ev dd 16 ev dd 16 v dd i/o v dd voltage generation/ power monitoring av ref 47 av ref 47 v ss 13 v ss 13 ev ss 14 ev ss 14 gnd ? ground av ss 48 av ss 48 notes 1. only the internal high-speed oscillation clock (f rh ) can be used when csi10 is used. 2. only the x1 clock (f x ) or external main system clock (f exclk ) can be used when uart60 is used. when using the clock output of t he dedicated flash memory programmer, pin connection varies depending on the type of the dedicated flash memory programmer used. ? pg-fp5, fl-pr5, pg-fp4, fl-pr4: connect clk of the programmer to exclk/x2/p122 (pin 10).
chapter 24 flash memory user?s manual u19180ej1v0ud 688 examples of the recommended connection when using the adapter for flash memory writing are shown below. figure 24-7. example of wiring adapter for flash memory writing in 3-wire serial i/o (csi10) mode (78k0/fe2) gnd v dd v dd2 v dd (2.3 to 5.5 v) gnd 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 si so sck clk /reset flmd0 writer interface
chapter 24 flash memory user?s manual u19180ej1v0ud 689 figure 24-8. example of wiring adapter for flash memory writing in uart (uart60) mode (78k0/fe2) gnd v dd v dd2 v dd (2.3 to 5.5 v) gnd 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 si so sck clk /reset flmd0 writer interface note note note the above figure illustrates an example of wiring when using the clock output from the pg-fp5 or fl-pr5 or pg-fp4 or fl-pr4.
chapter 24 flash memory user?s manual u19180ej1v0ud 690 table 24-6. wiring between 78k0/ff2 and dedicated flash memory programmer pin configuration of dedicated flash memory programmer with csi10 with uart60 signal name i/o pin function pin name pin no. pin name pin no. si/rxd input receive signal so10/p12 52 txd60/p13 51 so/txd output transmit signal si10/rxd61/p11 53 rxd60/p14 50 sck output transfer clock sck10/txd61/p10 54 ? ? clk output clock to 78k0/ff2 ? note 1 ? note 2 note 2 /reset output reset signal reset 10 reset 10 flmd0 output mode signal flmd0 13 flmd0 13 v dd 19 v dd 19 ev dd 20 ev dd 20 v dd i/o v dd voltage generation/ power monitoring av ref 59 av ref 59 v ss 17 v ss 17 ev ss 18 ev ss 18 gnd ? ground av ss 60 av ss 60 notes 1. only the internal high-speed oscillation clock (f rh ) can be used when csi10 is used. 2. only the x1 clock (f x ) or external main system clock (f exclk ) can be used when uart60 is used. when using the clock output of t he dedicated flash memory programmer, pin connection varies depending on the type of the dedicated flash memory programmer used. ? pg-fp5, fl-pr5, pg-fp4, fl-pr4: connect clk of the programmer to exclk/x2/p122 (pin 14).
chapter 24 flash memory user?s manual u19180ej1v0ud 691 examples of the recommended connection when using the adapter for flash memory writing are shown below. figure 24-9. example of wiring ad apter for flash memory writing in 3-wire serial i/o (csi10) mode (78k0/ff2) gnd 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 gnd vdd vdd2 v dd (2.7 to 5.5 v) writer interface si so sck clk /reset flmd0
chapter 24 flash memory user?s manual u19180ej1v0ud 692 figure 24-10. example of wiring adapter for flash memory writing in uart (uart60) mode (78k0/ff2) gnd 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 gnd vdd vdd2 v dd (2.7 to 5.5 v) writer interface si so sck clk /reset flmd0 note note note the above figure illustrates an example of wiring when using the clock output from the pg-fp5, fl-pr5, pg-fp4 or fl-pr4.
chapter 24 flash memory user?s manual u19180ej1v0ud 693 24.4 programming environment the environment required for writing a program to the flas h memory of the 78k0/fx2 microcontrollers are illustrated below. figure 24-11. environment for writing program to flash memory rs-232c host machine 78k0/fx2 microcontrollers v dd v ss reset csi10/uart60 usb flmd0 dedicated flash memory programmer pg-fp5 start power pass busy ng a host machine that controls the dedicated flash memory programmer is necessary. to interface between the dedicated flash memory pr ogrammer and the 78k0/fx2 mi crocontrollers, csi10 or uart60 is used for manipulation such as writing and erasi ng. to write the flash memory off-board, a dedicated program adapter (fa series) is necessary. 24.5 communication mode communication between the dedicated flash memory programmer and the 78k0/fx2 microcontrollers are established by serial communication via csi1 0 or uart60 of the 78k0/fx2 microcontrollers. (1) csi10 transfer rate: 2.4 khz to 2.5 mhz figure 24-12. communication with dedicated flash memory programmer (csi10) 78k0/fx2 microcontrollers reset so10 si10 sck10 v dd /ev dd /av ref v ss /ev ss /av ss flmd0 v dd gnd /reset si/rxd so/txd sck flmd0 dedicated flash memory programmer pg-fp5 start power pass busy ng
chapter 24 flash memory user?s manual u19180ej1v0ud 694 (2) uart60 transfer rate: 115200 bps figure 24-13. communication with dedicated flash memory programmer (uart60) 78k0/fx2 microcontrollers v dd /ev dd /av ref v ss /ev ss /av ss reset txd60 rxd60 v dd gnd /reset si/rxd so/txd flmd0 flmd0 exclk note clk note dedicated flash memory programmer pg-fp5 start power pass busy ng note the above figure illustrates an example of wiring when using the clock output fr om the pg-fp5, fl-pr5, pg-fp4 or fl-pr4. the dedicated flash memory programmer generates the following signals for the 78k0/fx2 microcontrollers. for details, refer to the user?s manual for the pg-fp5, fl-pr5, pg-fp4 or fl-pr4. table 24-7. pin connection dedicated flash memory programmer 78k0/fx2 microcontrollers connection signal name i/o pin function pin name csi10 uart60 flmd0 output mode signal flmd0 v dd i/o v dd voltage generation/power monitoring v dd , ev dd , av ref gnd ? ground v ss , ev ss , av ss clk output clock output to 78k0/fx2 microcontrollers note 1 note 2 { note 1 /reset output reset signal reset si/rxd input receive signal so10/txd60 so/txd output transmit signal si10/rxd60 sck output transfer clock sck10 notes 1. only the x1 clock (f x ) or external main system clock (f exclk ) can be used when uart60 is used. when using the clock output of t he dedicated flash memory programmer, pin connection varies depending on the type of the dedicated flash memory programmer used. ? pg-fp5, fl-pr5, pg-fp4, fl-pr4: connect clk of the programmer to exclk/x2/p122 (pin 14). 2. only the internal high-speed oscillation clock (f rh ) can be used when csi10 is used. remark : be sure to connect the pin. { : the pin does not have to be connected if the signal is generated on the target board. : the pin does not have to be connected.
chapter 24 flash memory user?s manual u19180ej1v0ud 695 24.6 connection of pins on board to write the flash memory on-board, connectors that connect the dedicated flash memory programmer must be provided on the target system. first provide a function that selects the normal operation mode or flash memory programming mode on the board. when the flash memory programming mode is set, all the pins not used for programming the flash memory are in the same status as immediately after re set. therefore, if the external device does not recognize the state immediately after reset, the pins must be handled as described below. 24.6.1 flmd0 pin in the normal operation mode, 0 v is input to the flmd 0 pin. in the flash memory programming mode, the v dd write voltage is supplied to the flmd0 pin. an flmd0 pin connection example is shown below. figure 24-14. flmd0 pin connection example 78k0/fx2 microcontrollers flmd0 10 k (recommended) dedicated flash memory programmer connection pin 24.6.2 serial interface pins the pins used by each serial interface are listed below. table 24-8. pins used by each serial interface serial interface pins used csi10 so10, si10, sck10 uart60 txd60, rxd60 to connect the dedicated flash memory programmer to the pins of a serial interface that is connected to another device on the board, care must be exer cised so that signals do not collide or that the other device does not malfunction.
chapter 24 flash memory user?s manual u19180ej1v0ud 696 (1) signal collision if the dedicated flash memory programmer (output) is connec ted to a pin (input) of a serial interface connected to another device (output), signal collision take s place. to avoid this collision, either isolate the connection with the other device, or make the other device go into an output high-impedance state. figure 24-15. signal collision (i nput pin of serial interface) input pin signal collision dedicated flash memory programmer connection pin other device output pin in the flash memory programming mode, the signal output by the device collides with the signal sent from the dedicated flash memory programmer. therefore, isolate the signal of the other device. 78k0/fx2 microcontrollers (2) malfunction of other device if the dedicated flash memory programmer (output or input) is connected to a pin (input or output) of a serial interface connected to another device (input), a signal ma y be output to the other devic e, causing the device to malfunction. to avoid this malfunction, isol ate the connection with the other device. figure 24-16. malfunction of other device pin dedicated flash memory programmer connection pin other device input pin if the signal output by the 78k0/fx2 microcontrollers in the flash memory programming mode affects the other device, isolate the signal of the other device. pin dedicated flash memory programmer connection pin other device input pin if the signal output by the dedicated flash memory programmer in the flash memory programming mode affects the other device, isolate the signal of the other device. 78k0/fx2 microcontrollers 78k0/fx2 microcontrollers
chapter 24 flash memory user?s manual u19180ej1v0ud 697 24.6.3 reset pin if the reset signal of the dedicated flash memory programm er is connected to the reset pin that is connected to the reset signal generator on the board, signal collision takes pl ace. to prevent this collis ion, isolate the connection with the reset signal generator. if the reset signal is input from the user system wh ile the flash memory programming mode is set, the flash memory will not be correctly programmed. do not input an y signal other than the reset signal of the dedicated flash memory programmer. figure 24-17. signal collision (reset pin) reset dedicated flash memory programmer connection signal reset signal generator signal collision output pin in the flash memory programming mode, the signal output by the reset signal generator collides with the signal output by the dedicated flash memory programmer. therefore, isolate the signal of the reset signal generator. 78k0/fx2 microcontrollers 24.6.4 port pins when the flash memory programming mode is set, all the pins not used for flash memory programming enter the same status as that immediately afte r reset. if external devices connected to the ports do not recognize the port status immediately after reset, the port pin must be connected to v dd or v ss via a resistor. 24.6.5 regc pin connect the regc pin to gnd via a capacitor (0.47 to 1 f: recommended) in the same manner as during normal operation. 24.6.6 other signal pins connect x1 and x2 in the same status as in t he normal operation mode when using the on-board clock. to input the operating clock from the dedicated flash memory programmer, however, connect as follows. ? pg-fp5, fl-pr5, pg-fp4, fl-pr4: connec t clk of the programmer to exclk/x2/p122. cautions 1. only the internal high-speed oscillation clock (f rh ) can be used when csi10 is used. 2. only the x1 clock (f x ) or external main system clock (f exclk ) can be used when uart60 is used. 3. connect p31/intp2/ti002 and p121/x1 as follows when writing the flash memory with a flash memory programmer. ? p31/intp2/ti002: connect to ev ss via a resistor (10 k : recommended). ? p121/x1: when using this pin as a port, connect it to v ss via a resistor (10 k : recommended) (in the input mode) or leave it open (in the output mode). the above connection is not necessary when writing the flash memory by means of self programming.
chapter 24 flash memory user?s manual u19180ej1v0ud 698 24.6.7 power supply to use the supply voltage output of the flash memory programmer, connect the v dd pin to v dd of the flash memory programmer, and the v ss pin to gnd of the flash memory programmer. to use the on-board supply voltage, connect in compliance with the normal operation mode. however, be sure to connect the v dd and v ss pins to v dd and gnd of the flash memory programmer to use the power monitor function with the flash memory progra mmer, even when using the on-board supply voltage. supply the same other power supplies (ev dd , ev ss , av ref , and av ss ) as those in the normal operation mode.
chapter 24 flash memory user?s manual u19180ej1v0ud 699 24.7 programming method 24.7.1 controlling flash memory the following figure illustrates the proc edure to manipulate the flash memory. figure 24-18. flash memory manipulation procedure start selecting communication mode manipulate flash memory end? yes flmd0 pulse supply no end flash memory programming mode is set 24.7.2 flash memory programming mode to rewrite the contents of the flash memory by using the dedicated flash memory programmer, set the 78k0/fx2 microcontrollers in the flash memory programming mode. to set the mode, set the flmd0 pin to v dd and clear the reset signal. change the mode by using a jumper when writing the flash memory on-board. figure 24-19. flash memory programming mode v dd reset 5.5 v 0 v v dd 0 v flash memory programming mode flmd0 flmd0 pulse v dd 0 v
chapter 24 flash memory user?s manual u19180ej1v0ud 700 table 24-9. relationship between flmd0 pin and operation mode after reset release flmd0 operation mode 0 normal operation mode v dd flash memory programming mode 24.7.3 selecting communication mode in the 78k0/fx2 microcontrollers, a co mmunication mode is selected by inputting pulses (up to 8 pulses) to the flmd0 pin after the dedicated flash memory programming mode is entered. these fl md0 pulses are generated by the flash memory programmer. the following table shows the relationship between the number of pulses and communication modes. table 24-10. communication modes standard setting note 1 communication mode port speed frequency multiply rate pins used peripheral clock number of flmd0 pulses uart-ext-osc f x 0 uart (uart60) uart-ext-fp4ck 115200 bps note 2 2 to 20 mhz note 3 txd60, rxd60 f exclk 3 3-wire serial i/o (csi10) csi-internal-osc 2.4 khz to 2.5 mhz ? 1.0 so10, si10, sck10 f rh 8 notes 1. selection items for standard settings on gu i of the flash memory programmer. 2. because factors other than the baud rate error, such as the signal waveform slew, also affect uart communication, thoroughly evaluate the slew as well as the baud rate error. 3. the possible setting range differs depending on the voltage. for details, refer to the chapter of electrical specifications. caution when uart60 is selected, the receive clock is calculated based on the reset command sent from the dedicated flash memory programmer after the flmd0 pulse has been received. remark f x : x1 clock f exclk : external main system clock f rh : internal high-speed oscillation clock
chapter 24 flash memory user?s manual u19180ej1v0ud 701 24.7.4 communication commands the 78k0/fx2 microcontrollers communicate with the de dicated flash memory programmer by using commands. the signals sent from the flash memory programmer to the 78k0/fx2 microcontrollers are called commands, and the signals sent from the 78k0/fx2 microcontrollers to t he dedicated flash memory programmer are called response. figure 24-20. communication commands 78k0/fx2 microcontrollers command response pg-fp5 start power pass busy ng dedicated flash memory programmer the flash memory control commands of the 78k0/fx2 micr ocontrollers are listed in the table below. all these commands are issued from the programmer and the 78k0/fx2 microcontrollers perform processing corresponding to the respective commands. table 24-11. flash memory control commands classification command name function verify verify compares the contents of a specified area of the flash memory with data transmitted from the programmer. chip erase erases the entire flash memory. erase block erase erases a specified area in the flash memory. blank check block blank check checks if a specified block in the flash memory has been correctly erased. write programming writes data to a specified area in the flash memory. status gets the current operating status (status data). silicon signature gets 78k0/fx2 information (such as the part number and flash memory configuration). version get gets the 78k0/fx2 version and firmware version. getting information checksum gets the checksum data for a specified area. security security set sets security information. reset used to detect synchroniza tion status of communication. others oscillating frequency set specifies an oscillation frequency. the 78k0/fx2 microcontrollers return a response for the command issued by the dedicated flash memory programmer. the response names sent from t he 78k0/fx2 microcontrollers are listed below. table 24-12. response names command name function ack acknowledges command/data. nak acknowledges illegal command/data.
chapter 24 flash memory user?s manual u19180ej1v0ud 702 24.8 security settings the 78k0/fx2 microcontrollers support a security function that prohibits rewriting the user program written to the internal flash memory, so that the program cannot be changed by an unauthorized person. the operations shown below can be performed using the secu rity set command. the security setting is valid when the programming mode is set next. ? disabling batch erase (chip erase) execution of the block erase and batch erase (chip erase) commands for entir e blocks in the flash memory is prohibited by this setting during on-board/off-board progr amming. once execution of the batch erase (chip erase) command is prohibited, all of the prohibition settings (including prohi bition of batch erase (chip erase)) can no longer be cancelled. caution after the security setting for the batch erase is set, erasure cannot be performed for the device. in addition, even if a write command is executed, data different from that which has already been written to the flash memory cannot be wr itten, because th e erase command is disabled. ? disabling block erase execution of the block erase command fo r a specific block in the flash memo ry is prohibited during on-board/off- board programming. however, blocks can be erased by means of self programming. ? disabling write execution of the write and block erase commands for ent ire blocks in the flash memory is prohibited during on- board/off-board programming. however, blocks c an be written by means of self programming. ? disabling rewriting boot cluster 0 execution of the batch erase (chip erase) command, block erase command, and write command on boot cluster 0 (0000h to 0fffh) in the flash memory is prohibited by this setting. caution if a security setting that rewrites boot cluster 0 has been applied, boot cluster 0 of that device will not be rewritten, and the device will not be erased in batch. the batch erase (chip erase), block erase, write commands, and rewriting boot cluster 0 are enabled by the default setting when the flash memory is shipped. security can be set by on-board/off-board programming and self programming. each security setting can be used in combination. prohibition of erasing blocks and wr iting is cleared by executing the batch erase (chip erase) command. table 24-13 shows the relationship between the erase an d write commands when the 78k0/fx2 microcontrollers security function is enabled.
chapter 24 flash memory user?s manual u19180ej1v0ud 703 table 24-13. relationship between enabling security function and command (1) during on-board/off-board programming executed command valid security batch erase (chip erase) block erase write prohibition of batch erase (c hip erase) cannot be erased in batch can be performed note . prohibition of block erase can be performed. prohibition of writing can be erased in batch. blocks cannot be erased. cannot be performed. prohibition of rewriting boot clus ter 0 cannot be erased in batch boot cluster 0 cannot be erased. boot cluster 0 cannot be written. note confirm that no data has been wri tten to the write area. because dat a cannot be erased after batch erase (chip erase) is prohibited, do not wr ite data if the data has not been erased. (2) during self programming executed command valid security block erase write prohibition of batch erase (chip erase) prohibition of block erase prohibition of writing blocks can be erased. can be performed. prohibition of rewriting boot cluster 0 boot cluster 0 cannot be erased. boot cluster 0 cannot be written. table 24-11 shows how to perform security settings in each programming mode. table 24-14. setting security in each programming mode (1) on-board/off-board programming security security setting how to disable security setting prohibition of batch erase (chip er ase) cannot be disabled after set. prohibition of block erase prohibition of writing execute batch erase (chip erase) command prohibition of rewriting boot cluster 0 set via gui of dedicated flash memory programmer, etc. cannot be disabled after set. (2) self programming security security setting how to disable security setting prohibition of batch erase (chip er ase) cannot be disabled after set. prohibition of block erase prohibition of writing execute batch erase (chip erase) command during on-board/off-board programming (cannot be disabled during self programming) prohibition of rewriting boot cluster 0 set by using information library. cannot be disabled after set.
chapter 24 flash memory user?s manual u19180ej1v0ud 704 24.9 processing time for each command when pg-fp4 or pg-fp5 is used (reference) the following table shows the processing time for each co mmand (reference) when the pg-fp4 or pg-fp5 is used as a dedicated flash memory programmer. table 24-15. processing time for each command when pg-fp4 or pg-fp5 is used (reference) (1/2) (1) pd78f0881a, 78f0884a (internal rom capacity: 32 kb) port: uart-ext-fp4ck (external main system clock (f exclk )), speed: 115,200 bps command of pg-fp4 port: csi-internal-osc (internal high-speed oscillation clock (f rh )), speed: 2.5 mhz frequency: 2.0 mhz frequency: 20 mhz signature 0.5 s (typ.) 0.5 s (typ.) 0.5 s (typ.) blankcheck 0.5 s (typ.) 0.5 s (typ.) 0.5 s (typ.) erase 0.5 s (typ.) 0.5 s (typ.) 0.5 s (typ.) program 2.5 s (typ.) 5 s (typ.) 5 s (typ.) verify 1.5 s (typ.) 4 s (typ.) 3.5 s (typ.) e.p.v 3.5 s (typ.) 6 s (typ.) 6 s (typ.) checksum 0.5 s (typ.) 0.5 s (typ.) 0.5 s (typ.) security 0.5 s (typ.) 0.5 s (typ.) 0.5 s (typ.) (2) pd78f0883a, 78f0886a (internal rom capacity: 60 kb) port: uart-ext-fp4ck (external main system clock (f exclk )), speed: 115,200 bps command of pg-fp4 port: csi-internal-osc (internal high-speed oscillation clock (f rh )), speed: 2.5 mhz frequency: 2.0 mhz frequency: 20 mhz signature 0.5 s (typ.) 0.5 s (typ.) 0.5 s (typ.) blankcheck 1 s (typ.) 1 s (typ.) 1 s (typ.) erase 1 s (typ.) 1 s (typ.) 1 s (typ.) program 5 s (typ.) 9 s (typ.) 9 s (typ.) verify 2 s (typ.) 6.5 s (typ.) 6.5 s (typ.) e.p.v 6 s (typ.) 10.5 s (typ.) 10.5 s (typ.) checksum 0.5 s (typ.) 1 s (typ.) 1 s (typ.) security 0.5 s (typ.) 0.5 s (typ.) 0.5 s (typ.) caution when executing boot swapping, do not use the e.p.v. command with the dedicated flash memory programmer.
chapter 24 flash memory user?s manual u19180ej1v0ud 705 table 24-15. processing time for each command when pg-fp4 or pg-fp5 is used (reference) (2/2) (3) pd78f0890a, 78f0893a, 78f0895a (internal rom capacity: 128 kb) port: uart-ext-fp4ck (external main system clock (f exclk )), speed: 115,200 bps command of pg-fp4 or pg-fp5 port: csi-internal-osc (internal high-speed oscillation clock (f rh )), speed: 2.5 mhz frequency: 2.0 mhz frequency: 20 mhz signature 0.5 s (typ.) 0.5 s (typ.) 0.5 s (typ.) blankcheck 1 s (typ.) 1 s (typ.) 1 s (typ.) erase 1.5 s (typ.) 1.5 s (typ.) 1.5 s (typ.) program 9.5 s (typ.) 18 s (typ.) 18 s (typ.) verify 4.5 s (typ.) 13.5 s (typ.) 13.5 s (typ.) e.p.v 11 s (typ.) 19.5 s (typ.) 19.5 s (typ.) checksum 1 s (typ.) 1 s (typ.) 1 s (typ.) security 0.5 s (typ.) 0.5 s (typ.) 0.5 s (typ.) caution when executing boot swapping, do not use the e.p.v. command with the dedicated flash memory programmer.
chapter 24 flash memory user?s manual u19180ej1v0ud 706 24.10 flash memory programming by self-programming the 78k0/fx2 microcontrollers support a self-programming f unction that can be used to rewrite the flash memory via a user program. because this function allows a us er application to rewrite the flash memory by using the 78k0/fx2 self-programming library, it can be used to upgrade the program in the field. if an interrupt occurs during self-programming, self-p rogramming can be temporarily stopped and interrupt servicing can be executed. to execute interrupt servicing, restore the normal operatio n mode after self-programming has been stopped, and execute t he ei instruction. after the self-pr ogramming mode is later restored, self- programming can be resumed. remark for details of the self-progra mming function and the 78k0/fx2 self-programming library, refer to a separate document to be published (document name: 78k0/fx2 applic ation note, release schedule: pending). cautions 1. the self-programming function cannot be used when the cpu operates with the subsystem clock. 2. input a high level to the flmd0 pin during self-programming. 3. be sure to execute the di instru ction before starting self-programming. the self-programming function checks the inte rrupt request flags (if0l, if0h, if1l, and if1h). if an interrupt request is generated, self-programming is stopped. 4. self-programming is also st opped by an interrupt request that is not masked even in the di status. to prevent this, mask the interrupt by using the interrupt mask flag registers (mk0l, mk0h, mk1l, and mk1h). 5. self-programming is executed with the intern al high-speed oscillati on clock. if the cpu operates with the x1 clock or external main syst em clock, the oscillation stabilization wait time of the internal high-speed oscilla tion clock elapses dur ing self-programming. (cautions 6 and 7 are listed on the next page.)
chapter 24 flash memory user?s manual u19180ej1v0ud 707 cautions 6. allocate the entry program for self-p rogramming in the common area of 0000h to 7fffh. figure 24-21. operation mode and memory map for self-programming (1) pd78f0883a, 78f0886a normal mode flash memory (common area) 0000h 8000h 7fffh ffffh fb00h faffh f000h efffh f800h f7ffh ff00h feffh internal high- speed ram internal expansion ram sfr flash memory control firmware rom disable accessing reserved flash memory control firmware rom enable accessing ffffh self-programming mode flash memory (common area) 0000h 8000h 7fffh fb00h faffh f000h efffh f800h f7ffh ff00h feffh internal high- speed ram internal expansion ram sfr reserved disable accessing instructions can be fetched from common area. instructions can be fetched from common area and firmware rom. fa00h f9ffh afcan area fa00h f9ffh afcan area (2) pd78f0890a, 78f0893a, 78f0895a memory bank 1 memory bank 4 memory bank 3 memory bank 5 memory bank 2 normal mode flash memory (common area) 0000h 8000h 7fffh ffffh fb00h faffh c000h bfffh f800h f7ffh e000h dfffh ff00h feffh internal high- speed ram internal expansion ram sfr reserved flash memory control firmware rom disable accessing flash memory (memory bank 0) memory bank 1 memory bank 4 memory bank 3 memory bank 5 memory bank 2 self-programming mode flash memory (common area) 0000h 8000h 7fffh ffffh fb00h faffh c000h bfffh f800h f7ffh fa00h f9ffh fa00h f9ffh e000h dfffh ff00h feffh internal high- speed ram internal expansion ram sfr reserved afcan area afcan area reserved reserved flash memory control firmware rom disable accessing enable accessing instructions can be fetched from common area and selected memory bank. instructions can be fetched from common area and firmware rom. 7. if the flash memory size is 96 kb or 128 kb, specify a flash real ad dress, instead of a cpu address, as a flash write/erase address.
chapter 24 flash memory user?s manual u19180ej1v0ud 708 table 24-16. correspondence among bank numbers, cpu addresses, and flash real addresses (a) pd78f0889a, 78f0892a, 78f0894a bank no. cpu address real address of flash memory ? 0000h to 7fffh (common area) 00000h to 07fffh 0 08000h to 0bfffh 1 0c000h to 0ffffh 2 10000h to 13fffh 3 8000h to bfffh 14000h to 17fffh 4 or more setting prohibited (b) pd78f0890a, 78f0893a, 78f0895a bank no. cpu address real address of flash memory ? 0000h to 7fffh (common area) 00000h to 07fffh 0 08000h to 0bfffh 1 0c000h to 0ffffh 2 10000h to 13fffh 3 14000h to 17fffh 4 18000h to 1bfffh 5 8000h to bfffh 1c000h to 1ffffh 6 or more setting prohibited
chapter 24 flash memory user?s manual u19180ej1v0ud 709 the following figure illustrates a flow of rewriting t he flash memory by using a self programming library. figure 24-22. flow of self-programming (rewriting flash memory) start of self programming flashstart flmd0 pin low level high level normal completion? yes no setting operating environment flashenv checkflmd flashblockblankcheck erased? yes yes no flashblockerase normal completion? flashwordwrite normal completion? flashblockverify normal completion? flashend flmd0 pin high level low level end of self programming yes yes no no no
chapter 24 flash memory user?s manual u19180ej1v0ud 710 the following table shows the processing time and interrupt re sponse time for the self programming sample library. table 24-17. processing time for self programming library (1/3) (1) when internal high-speed oscillation clock is u sed and entry ram is located outside short direct addressing range processing time ( s) normal model of c compiler static model of c compiler/assembler library name min. max. min. max. self programming start library 4.0 4.5 4.0 4.5 initialize library 1105.9 1106.6 1105.9 1106.6 mode check library 905.7 906.1 904.9 905.3 block blank check library 12776.1 12778.3 12770.9 12772.6 block erase library 26050.4 349971.3 26045.3 349965.6 word write library 1180.1 + 203 w 1184.3 + 2241 w 1172.9 + 203 w 1176.3 + 2241 w block verify library 25337.9 25340.2 25332.8 25334.5 self programming end library 4.0 4.5 4.0 4.5 option value: 03h 1072.9 1075.2 1067.5 1069.1 option value: 04h 1060.2 1062.6 1054.8 1056.6 get information library option value: 05h 1023.8 1028.2 1018.3 1022.1 set information library 70265.9 759995.0 70264.9 759994.0 eeprom write library 1316.8 + 347 w 1320.9 + 2385 w 1309.0 + 347 w 1312.4 + 2385 w (2) when internal high-speed oscilla tion clock is used and entry ram is located in short direct addressing range processing time ( s) normal model of c compiler static model of c compiler/assembler library name min. max. min. max. self programming start library 4.0 4.5 4.0 4.5 initialize library 449.5 450.2 449.5 450.2 mode check library 249.3 249.7 248.6 248.9 block blank check library 12119.7 12121.9 12114.6 12116.3 block erase library 25344.7 349266.4 25339.6 349260.8 word write library 445.8 + 203 w 449.9 + 2241 w 438.5 + 203 w 441.9 + 2241 w block verify library 24682.7 24684.9 24677.6 24679.3 self programming end library 4.0 4.5 4.0 4.5 option value: 03h 417.6 419.8 412.1 413.8 option value: 04h 405.0 407.4 399.5 401.3 get information library option value: 05h 367.4 371.8 361.9 365.8 set information library 69569.3 759297.3 69568.3 759296.2 eeprom write library 795.1 + 347 w 799.3 + 2385 w 787.4 + 347 w 790.8 + 2385 w remarks 1. the above processing times are those when a write st art address structure is located in the internal high-speed ram and during stabilized operation of t he internal high-speed oscillator (rsts = 1). 2. rsts: bit 7 of the internal oscillation mode register (rcm) 3. w: number of words in write data (1 word = 4 bytes)
chapter 24 flash memory user?s manual u19180ej1v0ud 711 table 24-17. processing time for self programming library (2/3) (3) when high-speed system clock (x 1 oscillation or external clock input) is used and entry ram is located outside short direct addressing range processing time ( s) normal model of c compiler static model of c compiler/assembler library name min. max. min. max. self programming start library 34/f cpu initialize library 55/f cpu + 594 mode check library 36/f cpu + 495 30/f cpu + 495 block blank check library 179/f cpu + 6429 136/f cpu + 6429 block erase library 179/f cpu + 19713 179/f cpu + 268079 136/f cpu + 19713 136/f cpu + 268079 word write library 333/f cpu + 647 + 136 w 333/f cpu + 647 + 1647 w 272/f cpu + 647 + 136 w 272/f cpu + 647 + 1647 w block verify library 179/f cpu + 13284 136/f cpu + 13284 self programming end library 34/f cpu option value: 03h 180/f cpu + 581 134f cpu + 581 option value: 04h 190/f cpu + 574 144/f cpu + 574 get information library option value: 05h 350/f cpu + 535 304/f cpu + 535 set information library 80/f cpu + 43181 80/f cpu + 572934 72/f cpu + 43181 72/f cpu + 572934 eeprom write library 333/f cpu + 729 + 209 w 333/f cpu + 729 + 1722 w 268/f cpu + 729 + 209 w 268/f cpu + 729 + 1722 w remarks 1. the above processing times are those when a write st art address structure is located in the internal high-speed ram and during stabilized operation of t he internal high-speed oscillator (rsts = 1). 2. rsts: bit 7 of the internal oscillation mode register (rcm) 3. f cpu : cpu operation clock frequency 4. w: number of words in write data (1 word = 4 bytes)
chapter 24 flash memory user?s manual u19180ej1v0ud 712 table 24-17. processing time for self programming library (3/3) (4) when high-speed system clock (x 1 oscillation or external clock input) is used and entry ram is located in short direct addressing range processing time ( s) normal model of c compiler static model of c compiler/assembler library name min. max. min. max. self programming start library 34/f cpu initialize library 55/f cpu + 272 mode check library 36/f cpu + 173 30/f cpu + 173 block blank check library 179/f cpu + 6108 136/f cpu + 6108 block erase library 179/f cpu + 19371 179/f cpu + 267738 136/f cpu + 19371 136/f cpu + 267738 word write library 333/f cpu + 247 + 136 w 333/f cpu + 247 + 1647 w 272/f cpu + 247 + 136 w 272/f cpu + 247 + 1647 w block verify library 179/f cpu +12964 136/f cpu +12964 self programming end library 34/f cpu option value: 03h 180/f cpu + 261 134/f cpu + 261 option value: 04h 190/f cpu + 254 144/f cpu + 254 get information library option value: 05h 350/f cpu + 213 304/f cpu + 213 set information library 80/f cpu + 42839 80/f cpu + 572592 72/f cpu + 42839 72/f cpu + 572592 eeprom write library 333/f cpu + 516 + 209 w 333/f cpu + 516 + 1722 w 268/f cpu + 516 + 209 w 268/f cpu + 516 + 1722 w remarks 1. the above processing times are those when a write st art address structure is located in the internal high-speed ram and during stabilized operation of t he internal high-speed oscillator (rsts = 1). 2. rsts: bit 7 of the internal oscillation mode register (rcm) 3. f cpu : cpu operation clock frequency 4. w: number of words in write data (1 word = 4 bytes)
chapter 24 flash memory user?s manual u19180ej1v0ud 713 table 24-18. interrupt response time for self programming library (1/2) (1) when internal high-speed oscillation clock is used interrupt response time ( s (max.)) normal model of c compiler static model of c compiler/assembler library name entry ram location is outside short direct addressing range entry ram location is in short direct addressing range entry ram location is outside short direct addressing range entry ram location is in short direct addressing range block blank check library 1100.9 431.9 1095.3 426.3 block erase library 1452.9 783.9 1447.3 778.3 word write library 1247.2 579.2 1239.2 571.2 block verify library 1125.9 455.9 1120.3 450.3 set information library 906.9 312.0 905.8 311.0 eeprom write library 1215.2 547.2 1213.9 545.9 remarks 1. the above interrupt response times are those during stabilized operation of the internal high-speed oscillator (rsts = 1). 2. rsts: bit 7 of the internal oscillation mode register (rcm) (2) when high-speed system clock is used (normal model of c compiler) interrupt response time ( s (max.)) rstop = 0, rsts = 1 rstop = 1 library name entry ram location is outside short direct addressing range entry ram location is in short direct addressing range entry ram location is outside short direct addressing range entry ram location is in short direct addressing range block blank check library 179/f cpu + 567 179/f cpu + 246 179/f cpu + 1708 179/f cpu + 569 block erase library 179/f cpu + 780 179/f cpu + 459 179/f cpu + 1921 179/f cpu + 782 word write library 333/f cpu + 763 333/f cpu + 443 333/f cpu + 1871 333/f cpu + 767 block verify library 179/f cpu + 580 179/f cpu + 259 179/f cpu + 1721 179/f cpu + 582 set information library 80/f cpu + 456 80/f cpu + 200 80/f cpu + 1598 80/f cpu + 459 29/f cpu + 767 29/f cpu + 447 29/f cpu + 767 29/f cpu + 447 eeprom write library note 333/f cpu + 696 333/f cpu + 376 333/f cpu + 1838 333/f cpu + 700 note the longer value of the eeprom write library interrupt response time becomes the max. value, depending on the value of f cpu . remarks 1. f cpu : cpu operation clock frequency 2. rstop: bit 0 of the internal oscillation mode register (rcm) 3. rsts: bit 7 of the internal oscillation mode register (rcm)
chapter 24 flash memory user?s manual u19180ej1v0ud 714 table 24-18. interrupt response time for self programming library (2/2) (3) when high-speed system clock is used (static model of c compiler/assembler) interrupt response time ( s (max.)) rstop = 0, rsts = 1 rstop = 1 library name entry ram location is outside short direct addressing range entry ram location is in short direct addressing range entry ram location is outside short direct addressing range entry ram location is in short direct addressing range block blank check library 136/f cpu + 567 136/f cpu + 246 136/f cpu + 1708 136/f cpu + 569 block erase library 136/f cpu + 780 136/f cpu + 459 136/f cpu + 1921 136/f cpu + 782 word write library 272/f cpu + 763 272/f cpu + 443 272/f cpu + 1871 272/f cpu + 767 block verify library 136/f cpu + 580 136/f cpu + 259 136/f cpu + 1721 136/f cpu + 582 set information library 72/f cpu + 456 72/f cpu + 200 72/f cpu + 1598 72/f cpu + 459 19/f cpu + 767 19/f cpu + 447 19/f cpu + 767 19/f cpu + 447 eeprom write library note 268/f cpu + 696 268/f cpu + 376 268/f cpu + 1838 268/f cpu + 700 note the longer value of the eeprom write library interrupt response time becomes the max. value, depending on the value of f cpu . remarks 1. f cpu : cpu operation clock frequency 2. rstop: bit 0 of the internal oscillation mode register (rcm) 3. rsts: bit 7 of the internal oscillation mode register (rcm)
chapter 24 flash memory user?s manual u19180ej1v0ud 715 24.10.1 registers used for self-programming function the following three registers are used for the self-programming function. ? flash-programming mode control register (flpmc) ? flash protect command register (pfcmd) ? flash status register (pfs) (1) flash-programming mode control register (flpmc) this register is used to enable or disable writing or erasing of the flash memory and to set the operation mode during self-programming. the flpmc can be written only in a specific sequence (see 24.10.1 (2) flash protect command register (pfcmd) ) so that the application system does not stop inadvertently due to malfunction caused by noise or program hang-up. flpmc can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation sets this register to 0xh note . note differs depending on the operation mode. ? user mode: 08h ? on-board mode: 0ch
chapter 24 flash memory user?s manual u19180ej1v0ud 716 figure 24-23. format of flash-programming mode control register (flpmc) 0 symbol flpmc 0 0 0 fwedis fwepr flspm1 flspm0 address: ffc4h after reset: 0 h note 1 r/w note 2 selection of operation mode during self-programming normal mode access (fetch of a command, lead of data) is possible to all the address domains of a flash memory. self-programming mode execution"call #8100 h" of firmware is possible. access (lead of an instruction fetch and data) is possible to a flash memory . setting prohibited flspm1 note 4 0 0 1 1 flspm0 note 4 0 1 1 0 fwedis 0 control of flash memory writing/erasing writing/erasing enabled note 3 writing/erasing disabled 1 status of flmd0 pin low level high level note 3 fwepr 0 1 notes 1. differs depending on the operation mode. ? user mode: 08h ? on-board mode: 0ch 2. bit 2 (fwepr) is read-only. 3. for actual writing/erasing, the flmd0 pin must be high (fwepr = 1), as well as fwedis = 0. fwedis fwepr enable or disable of flash memory writing/erasing 0 1 writing/erasing enabled other than above writing/erasing disabled 4. the user rom (flash memory) or firmware rom can be selected by flspm1 and flspm0, and the operation mode set on the a pplication system by the mode pin or the self-programming mode can be selected. cautions 1. be sure to keep fwedis at 0 until writing or erasing of the flash memory is completed. 2. make sure that fwedis = 1 in the normal mode. 3. manipulate flspm1 and flspm0 after execution branches to the internal ram. the address of the flash memory is specified by an address signal from the cpu when flspm1 = 0 or the set value of the firmware written when flspm1 = 1. in the on-board mode, the specifications of flspm1 and flspm0 are ignored.
chapter 24 flash memory user?s manual u19180ej1v0ud 717 (2) flash protect command register (pfcmd) if the application system stops inadver tently due to malfunction caused by noise or program hang-up, an operation to write the flash programming mode control register (flpmc) may hav e a serious effect on the system. pfcmd is used to protect flpmc from being written, so that the application system does not stop inadvertently. writing flpmc is enabled only when a write operation is performed in the following specific sequence. <1> write a specific value to pfcmd (pfcmd = a5h) <2> write the value to be set to fl pmc (writing in this step is invalid) <3> write the inverted value of the value to be set to flpmc <4> write the value to be set to flpmc (writing in this step is valid) this rewrites the value of the register, so that the register cannot be written illegally. occurrence of an illegal stor e operation can be checked by bit 0 (fprerr) of the flash status register (pfs). a5h must be written to pfcmd each time the value of flpmc is changed. pfcmd can be set by an 8-bit memory manipulation instruction. reset signal generation makes this register undefined. figure 24-24. format of flash protect command register (pfcmd) reg7 symbol pfcmd reg6 reg5 reg4 reg3 reg2 reg1 reg0 address: ffc0h after reset: undefined w (3) flash status register (pfs) if data is not written to the flash programming mode contro l register (flpmc), which is protected, in the correct sequence (writing the flash protect command register (p fcmd)), flpmc is not written and a protection error occurs. if this happens, bit 0 of pfs (fprerr) is set to 1. this bit is a cumulative fl ag. after checking fprerr, clear it by writing 0 to it. pfs can be set by a 1-bit or 8-bit memory manipulation instruction. reset signal generation clears this register to 00h. figure 24-25. format of flash status register (pfs) 0 symbol pfs 0 0 0 0 0 0 fprerr a ddress: ffc2h after reset: 00h r/w
chapter 24 flash memory user?s manual u19180ej1v0ud 718 the operating conditions of the fprerr flag are as follows. ? if pfcmd is written when the store instruction operation recently performed on a peripheral register is not to write a specific value (a5h) to pfcmd ? if the first store instruction operation after <1> is on a peripheral register other than flpmc ? if the first store instruction operation after <2> is on a peripheral register other than flpmc ? if a value other than the inverted value of the value to be set to flpmc is written by the first store instruction after <2> ? if the first store instruction operation after <3> is on a peripheral register other than flpmc ? if a value other than the value to be set to flpmc (value wr itten in <2>) is written by the first store instruction after <3> remark the numbers in angle brackets above correspond to the those in (2) flash protect command register (pfcmd) . ? if 0 is written to the fprerr flag ? if reset signal is generated to write 05h to flpmc mov pfcmd, #0a5h ; writes a5h to pfcmd. mov flpmc, #05h ; writes 05h to flpmc. mov flpmc, #0fah ; writes 0fah (i nverted value of 05h) to flpmc. mov flpmc, #05h ; writes 05h to flpmc.
chapter 24 flash memory user?s manual u19180ej1v0ud 719 24.11 boot swap function if rewriting the boot area has failed dur ing self-programming due to a power fa ilure or some other cause, the data in the boot area may be lost and the pr ogram may not be restarted by resetting. the boot swap function is used to avoid this problem. before erasing boot cluster 0 note , which is a boot program area, by self-p rogramming, write a new boot program to boot cluster 1 in advance. when the program has been correctly written to boot cluster 1, swap this boot cluster 1 and boot cluster 0 by using the set information function of the firmware of the 78k0/fx2 micr ocontrollers, so that boot cluster 1 is used as a boot area. after that, erase or write the original boot pr ogram area, boot cluster 0. as a result, even if a power failure occurs while the bo ot programming area is being rewritten, the program is executed correctly because it is booted from boot cluster 1 to be swapped when the program is reset and started next. if the program has been correctly written to boot cluster 0, restore the original bo ot area by using the set information function of t he firmware of the 78k0/fx2 microcontrollers. note a boot cluster is a 4 kb area and boot clusters 0 and 1 are swapped by the boot swap function. boot cluster 0 (0000h to 0fffh): original boot program area boot cluster 1 (1000h to 1fffh): area subject to boot swap function caution when executing boot swapping, do not use th e e.p.v command with the dedicated flash memory programmer. figure 24-26. boot swap function boot program (boot cluster 0) new boot program (boot cluster 1) user program self programming to boot cluster 1 self programming to boot cluster 0 setting of boot flag setting of boot flag user program boot program (boot cluster 0) user program new boot program (boot cluster 1) new boot program (boot cluster 0) user program new boot program (boot cluster 1) new boot program (boot cluster 0) user program new boot program (boot cluster 1) boot program (boot cluster 0) user program xxxxh xxxxh 2000h 0000h 1000h 2000h 0000h 1000h boot boot boot boot boot remark boot cluster 1 becomes 0000h to 0fffh when a re set is generated after t he boot flag has been set.
chapter 24 flash memory user?s manual u19180ej1v0ud 720 figure 24-27. example of executing boot swapping boot cluster 1 booted by boot cluster 0 booted by boot cluster 1 booted by boot cluster 0 block number erasing block 4 boot cluster 0 program program boot program 1000h 0000h 1000h 0000h 0000h 1000h erasing block 5 writing blocks 5 to 7 boot swap boot swap canceled 3 2 1 0 7 6 5 4 boot program boot program boot program program program program program boot program 3 2 1 0 7 6 5 4 boot program boot program boot program program program boot program 3 2 1 0 7 6 5 4 boot program boot program boot program program erasing block 6 erasing block 7 program boot program 3 2 1 0 7 6 5 4 boot program boot program boot program boot program 3 2 1 0 7 6 5 4 boot program boot program boot program boot program 3 2 1 0 7 6 5 4 boot program boot program boot program new boot program new boot program new boot program new boot program boot program 3 2 1 0 7 6 5 4 boot program boot program boot program new boot program new boot program new boot program new boot program erasing block 0 erasing block 1 erasing block 2 erasing block 3 3 2 1 0 7 6 5 4 boot program boot program boot program new boot program new boot program new boot program new boot program 3 2 1 0 7 6 5 4 boot program boot program new boot program new boot program new boot program new boot program 3 2 1 0 7 6 5 4 boot program new boot program new boot program new boot program new boot program 3 2 1 0 7 6 5 4 new boot program new boot program new boot program new boot program writing blocks 0 to 3 3 2 1 0 7 6 5 4 new boot program new boot program new boot program new boot program new boot program new boot program new boot program new boot program 3 2 1 0 7 6 5 4 new boot program new boot program new boot program new boot program new boot program new boot program new boot program new boot program
user?s manual u19180ej1v0ud 721 chapter 25 on-chip debug function 25.1 outline of functions on-chip debug function is mounted onto all 78k0/fx2 microcontroller products. the 78k0/fx2 microcontrollers uses the v dd , flmd0, reset, x1 (or p31), x2 (or p32), and v ss pins to communicate with the host machine via an on-chip debu g emulator (qb-78k0mini or qb-mini2). whether x1 and p31, or x2 and p32 are used can be selected. caution the 78k0/fx2 microcontrollers have an on-chip debug function, which is provided for development and evaluation. do not use the on-chip debug function in products designated for mass production, because the guaranteed number of rewritable times of the flash memory may be exceeded when this function is used, and product reliability therefore cannot be guaranteed. nec electronics is not liable for problems occurring when the on-chip debug function is used.
chapter 25 on-chip debug function user?s manual u19180ej1v0ud 722 25.2 connection with minicube or qb-mini2 in order to connect qb-78k0mini or qb-mini2, it is nec essary to mount the connector for emulator connection, and the circuit for connection on a target system. the connector for ocd (a two-row 2.54 pitch type connector, with reverse-insertion blocker) is described below. ? recommended connectors: (straight) hif3fc-10pa-2. 54dsa (manufactured by hirose electric co., ltd.) (right angle) hif3fc-10pa-2.54ds (manuf actured by hirose electric co., ltd.)) pin no. name in/out remark 1 reset_in in target reset input signal 2 reset_out out reset signal output to target device 3 flmd0 out output signal note used to control on-chip debugging functions 4 v dd _in in this signal is used to generate an interface output signal when the target system?s v dd is detected. 5 x2 in/out bidirectional signal used for data communications 6 gnd ? connected to gnd. 7 x1 out output signal used for clock supply 8 gnd ? connected to gnd. 9 reserved ? open 10 reserved ? open note flmd0 is at high level during on-chip debugging. figure 25-1. connector pin layout (top view) 10-pin general-purpose connector target system top view 2 9 10 7 8 5 6 3 4 1
chapter 25 on-chip debug function user?s manual u19180ej1v0ud 723 25.3 connection circuit examples the following are examples of circuits required when connecting the qb-78k0mini to the target system. figure 25-2. connection example of qb-78k0min i or qb-mini2 and 78k0/fx2 microcontrollers (when x1 and x2 are used) v dd target device p31 flmd0 x1 x2 reset signal reset_in note 1 x2 (data) note 3 x1 (clk) note 3 flmd0 reset v dd reset_out gnd target connector (10-pin) gnd note 2 v dd reset circuit v dd v dd gnd r.f.u. r.f.u. note 2 10 k (recommended) 1 k (recommended) (open) (open) notes 1. this connection is designed assuming that the rese t signal is output from the n-ch open-drain buffer (output resistance: 100 or less). for details, refer to qb-78k0mini user?s manual (u17029e) or qb- mini2 user?s manual (u18371e) . 2. make pull-down resistor 470 or more (10 k : recommended). 3. characters without parentheses represent the qb -78k0mini name, and those within parenthesis the qb-mini2 name. cautions 1. input the clock from the ocd0a/x1 pin during on-chip debugging. 2. control the x1 and x2 pins by externally pulling down the p31 pin or by using an external circuit using the p130 pin (that outputs a low level when the device is reset).
chapter 25 on-chip debug function user?s manual u19180ej1v0ud 724 figure 25-3. connection example of qb-78k0min i or qb-mini2 and 78k0/fx2 microcontrollers (when p31 and p32 are used) v dd target device flmd0 p31 p32 reset signal reset_in note 1 x2 (data) note 4 x1 (clk) note 4 flmd0 reset v dd reset_out gnd target connector (10-pin) gnd note 3 v dd reset circuit v dd v dd gnd r.f.u. r.f.u. note 3 1 k (recommended) 10 k (recommended) (open) (open) v dd 3 to 10 k (recommended) note 2 notes 1. this connection is designed assuming that the rese t signal is output from the n-ch open-drain buffer (output resistance: 100 or less). for details, refer to qb-78k0mini user?s manual (u17029e) or qb- mini2 user?s manual (u18371e) . 2. this is the processing of the pin when p32 is set as the input port (to prevent the pin from being left opened when not connected to qb-78k0mini or qb-mini2). 3. make pull-down resistor 470 or more (10 k : recommended). 4. characters without parentheses represent the qb -78k0mini name, and those within parenthesis the qb-mini2 name. connect the flmd0 pin as follows when performing se lf programming by means of on-chip debugging. figure 25-4. connection of flmd0 pin for se lf programming by means of on-chip debugging qb-78k0mini target connector flmd0 flmd0 target device port 1 k (recommended) 10 k (recommended)
chapter 25 on-chip debug function user?s manual u19180ej1v0ud 725 25.4 reserved area used by qb-78k0mini and qb-mini2 qb-78k0mini and qb-mini2 use the reserved areas shown in figure 25-5 below to implement communication with the 78k0/fx2 microcontrollers, or each debug function. the shaded reserved areas are used for the respective debug functions to be used, and the othe r areas are always used for debugging. these reserved areas can be secured by using user programs and compiler options. when using a boot swap operation during self programmi ng, set the same value to boot cluster 1 beforehand. for details on reserved area, refer to qb-78k0mini user?s manual (u17029e) or qb-mini2 user?s manual (u18371e) . figure 25-5. reserved area used by qb-78k0mini and qb-mini2 debug monitor area (2 bytes) software break area (2 bytes) security id area (10 bytes) option byte area (1 byte) debug monitor area (257 bytes) pseudo rrm area (256 bytes) internal rom space internal ram space stack area for debugging (max. 16 bytes) pseudo rrm area (16 bytes) ff7fh f7f0h 28fh 190h 18fh 8fh 8eh 85h 84h 7fh 7eh 03h 02h 00h remark shaded reserved areas: area used for the respective debug functions to be used other reserved areas: areas always used for debugging
chapter 25 on-chip debug function user?s manual u19180ej1v0ud 726 25.5 on-chip debug security id the 78k0/fx2 microcontrollers have an on-chip debug operat ion control flag in the flash memory at 0084h (see chapter 23 option byte ) and an on-chip debug security id setting area at 0085h to 008eh. when the boot swap function is used, also set a value that is the same as that of 1084h and 1085h to 108eh in advance, because 0084h, 0085h to 008eh and 1084h, and 1085h to 108eh are switched. for details on the on-chip debug security id, refer to the qb-78k0mini user?s manual (u17029e) or qb-mini2 user?s manual (u18731e) . table 25-1. on-chip debug security id address on-chip debug security id 0085h to 008eh 1085h to 108eh any id code of 10 bytes 25.6 restrictions and cautions on on-chip debug function when setting to on-chip debugging mode via the normal port, without using pins x1 and x2, two of the user ports will be unavailable for use. in order to realize on-chip debug function, use the following user resource. (a) flash memory area { addresses 0x02 and 0x03 { addresses 0x7e and 0x7f (when using a software break) { address 0x84 { addresses 0x85 to 0x8e { addresses 0x8f to 0x18f: standard value of program (+256 bytes when using pseudo real-time ram monitor function) (when using a device with 10 or more sfrs the can be accessed in 16-bit units: +n (the number of exceeding registers x 6 bytes)) (b) internal extended ram area { addresses 0xf7f0 to 0xf7ff (when using pseudo real-time ram monitor function) (c) internal high-speed ram area { 7 bytes as stack area: standard value of stack (+2 bytes when using software breaks) (+7 bytes when using pseudo real-time ram monitor function) for details, refer to the qb-78k0mini user's manual (u17029e) or qb-mini2 user?s manual (u18731e) .
user?s manual u19180ej1v0ud 727 chapter 26 instruction set this chapter lists each instruction set of 78k0/fx2 microcontrollers in table form. for details of each operation and operation code, refer to the separate document 78k/0 series instructions user?s manual (u12326e) . 26.1 conventions used in operation list 26.1.1 operand identifier s and specification methods operands are written in the ?operand? column of each instruction in accordan ce with the specification method of the instruction operand identifier (refer to the assembler s pecifications for details). when there are two or more methods, select one of them. upper case letters and the sym bols #, !, $ and [ ] are keywords and must be written as they are. each symbol has the following meaning. ? #: immediate data specification ? !: absolute address specification ? $: relative address specification ? [ ]: indirect address specification in the case of immediate data, describe an appropriate num eric value or a label. when using a label, be sure to write the #, !, $, and [ ] symbols. for operand register identifiers r and rp, either function names (x, a, c, etc.) or absolute names (names in parentheses in the table below, r0, r1, r2, etc.) can be used for specification. table 26-1. operand identifi ers and specification methods identifier specification method r rp sfr sfrp x (r0), a (r1), c (r2), b (r3), e (r4), d (r5), l (r6), h (r7), ax (rp0), bc (rp1), de (rp2), hl (rp3) special function register symbol note special function register symbol (16-bit manipulatable register even addresses only) note saddr saddrp fe20h to ff1fh immediate data or labels fe20h to ff1fh immediate data or labels (even address only) addr16 addr11 addr5 0000h to ffffh immediate data or labels (only even addresses for 16-bit data transfer instructions) 0800h to 0fffh immediate data or labels 0040h to 007fh immediate data or labels (even address only) word byte bit 16-bit immediate data or label 8-bit immediate data or label 3-bit immediate data or label rbn rb0 to rb3 note addresses from ffd0h to ffdfh cannot be accessed with these operands. remark for special function register symbols, see table 3-7. special function register list .
chapter 26 instruction set user?s manual u19180ej1v0ud 728 26.1.2 description of operation column a: a register; 8-bit accumulator x: x register b: b register c: c register d: d register e: e register h: h register l: l register ax: ax register pair ; 16-bit accumulator bc: bc register pair de: de register pair hl: hl register pair pc: program counter sp: stack pointer psw: program status word cy: carry flag ac: auxiliary carry flag z: zero flag rbs: register bank select flag ie: interrupt request enable flag ( ): memory contents indicated by addr ess or register contents in parentheses x h , x l : higher 8 bits and lower 8 bits of 16-bit register : logical product (and) : logical sum (or) : exclusive logical sum (exclusive or) ?? : inverted data addr16: 16-bit immediate data or label jdisp8: signed 8-bit data (displacement value) 26.1.3 description of flag operation column (blank): not affected 0: cleared to 0 1: set to 1 : set/cleared according to the result r: previously saved value is restored
chapter 26 instruction set user?s manual u19180ej1v0ud 729 26.2 operation list clocks flag instruction group mnemonic operands bytes note 1 note 2 operation zaccy r, #byte 2 4 ? r byte saddr, #byte 3 6 7 (saddr) byte sfr, #byte 3 ? 7 sfr byte a, r note 3 1 2 ? a r r, a note 3 1 2 ? r a a, saddr 2 4 5 a (saddr) saddr, a 2 4 5 (saddr) a a, sfr 2 ? 5 a sfr sfr, a 2 ? 5 sfr a a, !addr16 3 8 9 a (addr16) !addr16, a 3 8 9 (addr16) a psw, #byte 3 ? 7 psw byte a, psw 2 ? 5 a psw psw, a 2 ? 5 psw a a, [de] 1 4 5 a (de) [de], a 1 4 5 (de) a a, [hl] 1 4 5 a (hl) [hl], a 1 4 5 (hl) a a, [hl + byte] 2 8 9 a (hl + byte) [hl + byte], a 2 8 9 (hl + byte) a a, [hl + b] 1 6 7 a (hl + b) [hl + b], a 1 6 7 (hl + b) a a, [hl + c] 1 6 7 a (hl + c) mov [hl + c], a 1 6 7 (hl + c) a a, r note 3 1 2 ? a ? r a, saddr 2 4 6 a ? (saddr) a, sfr 2 ? 6 a ? (sfr) a, !addr16 3 8 10 a ? (addr16) a, [de] 1 4 6 a ? (de) a, [hl] 1 4 6 a ? (hl) a, [hl + byte] 2 8 10 a ? (hl + byte) a, [hl + b] 2 8 10 a ? (hl + b) 8-bit data transfer xch a, [hl + c] 2 8 10 a ? (hl + c) notes 1. when the internal high-speed ram area is accessed or for an instruction with no data access 2. when an area except the internal high-speed ram area is accessed 3. except ?r = a? remarks 1. one instruction clock cycle is one cycle of the cpu clock (f cpu ) selected by the processor clock control register (pcc). 2. this clock cycle applies to the internal rom program.
chapter 26 instruction set user?s manual u19180ej1v0ud 730 clocks flag instruction group mnemonic operands bytes note 1 note 2 operation zaccy rp, #word 3 6 ? rp word saddrp, #word 4 8 10 (saddrp) word sfrp, #word 4 ? 10 sfrp word ax, saddrp 2 6 8 ax (saddrp) saddrp, ax 2 6 8 (saddrp) ax ax, sfrp 2 ? 8 ax sfrp sfrp, ax 2 ? 8 sfrp ax ax, rp note 3 1 4 ? ax rp rp, ax note 3 1 4 ? rp ax ax, !addr16 3 10 12 ax (addr16) movw !addr16, ax 3 10 12 (addr16) ax 16-bit data transfer xchw ax, rp note 3 1 4 ? ax ? rp a, #byte 2 4 ? a, cy a + byte saddr, #byte 3 6 8 (saddr), cy (saddr) + byte a, r note 4 2 4 ? a, cy a + r r, a 2 4 ? r, cy r + a a, saddr 2 4 5 a, cy a + (saddr) a, !addr16 3 8 9 a, cy a + (addr16) a, [hl] 1 4 5 a, cy a + (hl) a, [hl + byte] 2 8 9 a, cy a + (hl + byte) a, [hl + b] 2 8 9 a, cy a + (hl + b) add a, [hl + c] 2 8 9 a, cy a + (hl + c) a, #byte 2 4 ? a, cy a + byte + cy saddr, #byte 3 6 8 (saddr), cy (saddr) + byte + cy a, r note 4 2 4 ? a, cy a + r + cy r, a 2 4 ? r, cy r + a + cy a, saddr 2 4 5 a, cy a + (saddr) + cy a, !addr16 3 8 9 a, cy a + (addr16) + c a, [hl] 1 4 5 a, cy a + (hl) + cy a, [hl + byte] 2 8 9 a, cy a + (hl + byte) + cy a, [hl + b] 2 8 9 a, cy a + (hl + b) + cy 8-bit operation addc a, [hl + c] 2 8 9 a, cy a + (hl + c) + cy notes 1. when the internal high-speed ram area is accessed or for an instruction with no data access 2. when an area except the internal high-speed ram area is accessed 3. only when rp = bc, de or hl 4. except ?r = a? remarks 1. one instruction clock cycle is one cycle of the cpu clock (f cpu ) selected by the processor clock control register (pcc). 2. this clock cycle applies to the internal rom program.
chapter 26 instruction set user?s manual u19180ej1v0ud 731 clocks flag instruction group mnemonic operands bytes note 1 note 2 operation zaccy a, #byte 2 4 ? a, cy a ? byte saddr, #byte 3 6 8 (saddr), cy (saddr) ? byte a, r note 3 2 4 ? a, cy a ? r r, a 2 4 ? r, cy r ? a a, saddr 2 4 5 a, cy a ? (saddr) a, !addr16 3 8 9 a, cy a ? (addr16) a, [hl] 1 4 5 a, cy a ? (hl) a, [hl + byte] 2 8 9 a, cy a ? (hl + byte) a, [hl + b] 2 8 9 a, cy a ? (hl + b) sub a, [hl + c] 2 8 9 a, cy a ? (hl + c) a, #byte 2 4 ? a, cy a ? byte ? cy saddr, #byte 3 6 8 (saddr), cy (saddr) ? byte ? cy a, r note 3 2 4 ? a, cy a ? r ? cy r, a 2 4 ? r, cy r ? a ? cy a, saddr 2 4 5 a, cy a ? (saddr) ? cy a, !addr16 3 8 9 a, cy a ? (addr16) ? cy a, [hl] 1 4 5 a, cy a ? (hl) ? cy a, [hl + byte] 2 8 9 a, cy a ? (hl + byte) ? cy a, [hl + b] 2 8 9 a, cy a ? (hl + b) ? cy subc a, [hl + c] 2 8 9 a, cy a ? (hl + c) ? cy a, #byte 2 4 ? a a byte saddr, #byte 3 6 8 (saddr) (saddr) byte a, r note 3 2 4 ? a a r r, a 2 4 ? r r a a, saddr 2 4 5 a a (saddr) a, !addr16 3 8 9 a a (addr16) a, [hl] 1 4 5 a a [hl] a, [hl + byte] 2 8 9 a a [hl + byte] a, [hl + b] 2 8 9 a a [hl + b] 8-bit operation and a, [hl + c] 2 8 9 a a [hl + c] notes 1. when the internal high-speed ram area is accessed or for an instruction with no data access 2. when an area except the internal high-speed ram area is accessed 3. except ?r = a? remarks 1. one instruction clock cycle is one cycle of the cpu clock (f cpu ) selected by the processor clock control register (pcc). 2. this clock cycle applies to the internal rom program.
chapter 26 instruction set user?s manual u19180ej1v0ud 732 clocks flag instruction group mnemonic operands bytes note 1 note 2 operation zaccy a, #byte 2 4 ? a a byte saddr, #byte 3 6 8 (saddr) (saddr) byte a, r note 3 2 4 ? a a r r, a 2 4 ? r r a a, saddr 2 4 5 a a (saddr) a, !addr16 3 8 9 a a (addr16) a, [hl] 1 4 5 a a (hl) a, [hl + byte] 2 8 9 a a (hl + byte) a, [hl + b] 2 8 9 a a (hl + b) or a, [hl + c] 2 8 9 a a (hl + c) a, #byte 2 4 ? a a byte saddr, #byte 3 6 8 (saddr) (saddr) byte a, r note 3 2 4 ? a a r r, a 2 4 ? r r a a, saddr 2 4 5 a a (saddr) a, !addr16 3 8 9 a a (addr16) a, [hl] 1 4 5 a a (hl) a, [hl + byte] 2 8 9 a a (hl + byte) a, [hl + b] 2 8 9 a a (hl + b) xor a, [hl + c] 2 8 9 a a (hl + c) a, #byte 2 4 ? a ? byte saddr, #byte 3 6 8 (saddr) ? byte a, r note 3 2 4 ? a ? r r, a 2 4 ? r ? a a, saddr 2 4 5 a ? (saddr) a, !addr16 3 8 9 a ? (addr16) a, [hl] 1 4 5 a ? (hl) a, [hl + byte] 2 8 9 a ? (hl + byte) a, [hl + b] 2 8 9 a ? (hl + b) 8-bit operation cmp a, [hl + c] 2 8 9 a ? (hl + c) notes 1. when the internal high-speed ram area is accessed or for an instruction with no data access 2. when an area except the internal high-speed ram area is accessed 3. except ?r = a? remarks 1. one instruction clock cycle is one cycle of the cpu clock (f cpu ) selected by the processor clock control register (pcc). 2. this clock cycle applies to the internal rom program.
chapter 26 instruction set user?s manual u19180ej1v0ud 733 clocks flag instruction group mnemonic operands bytes note 1 note 2 operation zaccy addw ax, #word 3 6 ? ax, cy ax + word subw ax, #word 3 6 ? ax, cy ax ? word 16-bit operation cmpw ax, #word 3 6 ? ax ? word mulu x 2 16 ? ax a x multiply/ divide divuw c 2 25 ? ax (quotient), c (remainder) ax c r 1 2 ? r r + 1 inc saddr 2 4 6 (saddr) (saddr) + 1 r 1 2 ? r r ? 1 dec saddr 2 4 6 (saddr) (saddr) ? 1 incw rp 1 4 ? rp rp + 1 increment/ decrement decw rp 1 4 ? rp rp ? 1 ror a, 1 1 2 ? (cy, a 7 a 0 , a m ? 1 a m ) 1 time rol a, 1 1 2 ? (cy, a 0 a 7 , a m + 1 a m ) 1 time rorc a, 1 1 2 ? (cy a 0 , a 7 cy, a m ? 1 a m ) 1 time rolc a, 1 1 2 ? (cy a 7 , a 0 cy, a m + 1 a m ) 1 time ror4 [hl] 2 10 12 a 3 ? 0 (hl) 3 ? 0 , (hl) 7 ? 4 a 3 ? 0 , (hl) 3 ? 0 (hl) 7 ? 4 rotate rol4 [hl] 2 10 12 a 3 ? 0 (hl) 7 ? 4 , (hl) 3 ? 0 a 3 ? 0 , (hl) 7 ? 4 (hl) 3 ? 0 adjba 2 4 ? decimal adjust accumulator after addition bcd adjustment adjbs 2 4 ? decimal adjust accumulator after subtract cy, saddr.bit 3 6 7 cy (saddr.bit) cy, sfr.bit 3 ? 7 cy sfr.bit cy, a.bit 2 4 ? cy a.bit cy, psw.bit 3 ? 7 cy psw.bit cy, [hl].bit 2 6 7 cy (hl).bit saddr.bit, cy 3 6 8 (saddr.bit) cy sfr.bit, cy 3 ? 8 sfr.bit cy a.bit, cy 2 4 ? a.bit cy psw.bit, cy 3 ? 8 psw.bit cy bit manipulate mov1 [hl].bit, cy 2 6 8 (hl).bit cy notes 1. when the internal high-speed ram area is accessed or for an instruction with no data access 2. when an area except the internal high-speed ram area is accessed remarks 1. one instruction clock cycle is one cycle of the cpu clock (f cpu ) selected by the processor clock control register (pcc). 2. this clock cycle applies to the internal rom program.
chapter 26 instruction set user?s manual u19180ej1v0ud 734 clocks flag instruction group mnemonic operands bytes note 1 note 2 operation zaccy cy, saddr.bit 3 6 7 cy cy saddr.bit) cy, sfr.bit 3 ? 7 cy cy sfr.bit cy, a.bit 2 4 ? cy cy a.bit cy, psw.bit 3 ? 7 cy cy psw.bit and1 cy, [hl].bit 2 6 7 cy cy (hl).bit cy, saddr.bit 3 6 7 cy cy (saddr.bit) cy, sfr.bit 3 ? 7 cy cy sfr.bit cy, a.bit 2 4 ? cy cy a.bit cy, psw.bit 3 ? 7 cy cy psw.bit or1 cy, [hl].bit 2 6 7 cy cy (hl).bit cy, saddr.bit 3 6 7 cy cy (saddr.bit) cy, sfr.bit 3 ? 7 cy cy sfr.bit cy, a.bit 2 4 ? cy cy a.bit cy, psw. bit 3 ? 7 cy cy psw.bit xor1 cy, [hl].bit 2 6 7 cy cy (hl).bit saddr.bit 2 4 6 (saddr.bit) 1 sfr.bit 3 ? 8 sfr.bit 1 a.bit 2 4 ? a.bit 1 psw.bit 2 ? 6 psw.bit 1 set1 [hl].bit 2 6 8 (hl).bit 1 saddr.bit 2 4 6 (saddr.bit) 0 sfr.bit 3 ? 8 sfr.bit 0 a.bit 2 4 ? a.bit 0 psw.bit 2 ? 6 psw.bit 0 clr1 [hl].bit 2 6 8 (hl).bit 0 set1 cy 1 2 ? cy 1 1 clr1 cy 1 2 ? cy 0 0 bit manipulate not1 cy 1 2 ? cy cy notes 1. when the internal high-speed ram area is accessed or for an instruction with no data access 2. when an area except the internal high-speed ram area is accessed remarks 1. one instruction clock cycle is one cycle of the cpu clock (f cpu ) selected by the processor clock control register (pcc). 2. this clock cycle applies to the internal rom program.
chapter 26 instruction set user?s manual u19180ej1v0ud 735 clocks flag instruction group mnemonic operands bytes note 1 note 2 operation zaccy call !addr16 3 7 ? (sp ? 1) (pc + 3) h , (sp ? 2) (pc + 3) l , pc addr16, sp sp ? 2 callf !addr11 2 5 ? (sp ? 1) (pc + 2) h , (sp ? 2) (pc + 2) l , pc 15 ? 11 00001, pc 10 ? 0 addr11, sp sp ? 2 callt [addr5] 1 6 ? (sp ? 1) (pc + 1) h , (sp ? 2) (pc + 1) l , pc h (addr5 + 1), pc l (addr5), sp sp ? 2 brk 1 6 ? (sp ? 1) psw, (sp ? 2) (pc + 1) h , (sp ? 3) (pc + 1) l , pc h (003fh), pc l (003eh), sp sp ? 3, ie 0 ret 1 6 ? pc h (sp + 1), pc l (sp), sp sp + 2 reti 1 6 ? pc h (sp + 1), pc l (sp), psw (sp + 2), sp sp + 3 rrr call/return retb 1 6 ? pc h (sp + 1), pc l (sp), psw (sp + 2), sp sp + 3 rrr psw 1 2 ? (sp ? 1) psw, sp sp ? 1 push rp 1 4 ? (sp ? 1) rp h , (sp ? 2) rp l , sp sp ? 2 psw 1 2 ? psw (sp), sp sp + 1 r r r pop rp 1 4 ? rp h (sp + 1), rp l (sp), sp sp + 2 sp, #word 4 ? 10 sp word sp, ax 2 ? 8 sp ax stack manipulate movw ax, sp 2 ? 8 ax sp !addr16 3 6 ? pc addr16 $addr16 2 6 ? pc pc + 2 + jdisp8 unconditional branch br ax 2 8 ? pch a, pc l x bc $addr16 2 6 ? pc pc + 2 + jdisp8 if cy = 1 bnc $addr16 2 6 ? pc pc + 2 + jdisp8 if cy = 0 bz $addr16 2 6 ? pc pc + 2 + jdisp8 if z = 1 conditional branch bnz $addr16 2 6 ? pc pc + 2 + jdisp8 if z = 0 notes 1. when the internal high-speed ram area is accessed or for an instruction with no data access 2. when an area except the internal high-speed ram area is accessed remarks 1. one instruction clock cycle is one cycle of the cpu clock (f cpu ) selected by the processor clock control register (pcc). 2. this clock cycle applies to the internal rom program.
chapter 26 instruction set user?s manual u19180ej1v0ud 736 clocks flag instruction group mnemonic operands bytes note 1 note 2 operation zaccy saddr.bit, $addr16 3 8 9 pc pc + 3 + jdisp8 if(saddr.bit) = 1 sfr.bit, $addr16 4 ? 11 pc pc + 4 + jdisp8 if sfr.bit = 1 a.bit, $addr16 3 8 ? pc pc + 3 + jdisp8 if a.bit = 1 psw.bit, $addr16 3 ? 9 pc pc + 3 + jdisp8 if psw.bit = 1 bt [hl].bit, $addr16 3 10 11 pc pc + 3 + jdisp8 if (hl).bit = 1 saddr.bit, $addr16 4 10 11 pc pc + 4 + jdisp8 if(saddr.bit) = 0 sfr.bit, $addr16 4 ? 11 pc pc + 4 + jdisp8 if sfr.bit = 0 a.bit, $addr16 3 8 ? pc pc + 3 + jdisp8 if a.bit = 0 psw.bit, $addr16 4 ? 11 pc pc + 4 + jdisp8 if psw. bit = 0 bf [hl].bit, $addr16 3 10 11 pc pc + 3 + jdisp8 if (hl).bit = 0 saddr.bit, $addr16 4 10 12 pc pc + 4 + jdisp8 if(saddr.bit) = 1 then reset(saddr.bit) sfr.bit, $addr16 4 ? 12 pc pc + 4 + jdisp8 if sfr.bit = 1 then reset sfr.bit a.bit, $addr16 3 8 ? pc pc + 3 + jdisp8 if a.bit = 1 then reset a.bit psw.bit, $addr16 4 ? 12 pc pc + 4 + jdisp8 if psw.bit = 1 then reset psw.bit btclr [hl].bit, $addr16 3 10 12 pc pc + 3 + jdisp8 if (hl).bit = 1 then reset (hl).bit b, $addr16 2 6 ? b b ? 1, then pc pc + 2 + jdisp8 if b 0 c, $addr16 2 6 ? c c ? 1, then pc pc + 2 + jdisp8 if c 0 conditional branch dbnz saddr, $addr16 3 8 10 (saddr) (saddr) ? 1, then pc pc + 3 + jdisp8 if(saddr) 0 sel rbn 2 4 ? rbs1, 0 n nop 1 2 ? no operation ei 2 ? 6 ie 1(enable interrupt) di 2 ? 6 ie 0(disable interrupt) halt 2 6 ? set halt mode cpu control stop 2 6 ? set stop mode notes 1. when the internal high-speed ram area is accessed or for an instruction with no data access 2. when an area except the internal high-speed ram area is accessed remarks 1. one instruction clock cycle is one cycle of the cpu clock (f cpu ) selected by the processor clock control register (pcc). 2. this clock cycle applies to the internal rom program.
chapter 26 instruction set user?s manual u19180ej1v0ud 737 26.3 instructions listed by addressing type (1) 8-bit instructions mov, xch, add, addc, sub, subc , and, or, xor, cmp, mulu, divu w, inc, dec, ro r, rol, rorc, rolc, ror4, rol4, push, pop, dbnz second operand first operand #byte a r note sfr saddr !addr16 psw [de] [hl] [hl + byte] [hl + b] [hl + c] $addr16 1 none a add addc sub subc and or xor cmp mov xch add addc sub subc and or xor cmp mov xch mov xch add addc sub subc and or xor cmp mov xch add addc sub subc and or xor cmp mov mov xch mov xch add addc sub subc and or xor cmp mov xch add addc sub subc and or xor cmp ror rol rorc rolc r mov mov add addc sub subc and or xor cmp inc dec b, c dbnz sfr mov mov saddr mov add addc sub subc and or xor cmp mov dbnz inc dec !addr16 mov psw mov mov push pop [de] mov [hl] mov ror4 rol4 [hl + byte] [hl + b] [hl + c] mov x mulu c divuw note except ?r = a?
chapter 26 instruction set user?s manual u19180ej1v0ud 738 (2) 16-bit instructions movw, xchw, addw, subw, cmpw , push, pop, incw, decw second operand first operand #word ax rp note sfrp saddrp !addr16 sp none ax addw subw cmpw movw xchw movw movw movw movw rp movw movw note incw decw push pop sfrp movw movw saddrp movw movw !addr16 movw sp movw movw note only when rp = bc, de, hl (3) bit manipulation instructions mov1, and1, or1, xor1, set1 , clr1, not1, bt, bf, btclr second operand first operand a.bit sfr.bit saddr.bit psw.bit [hl].bit cy $addr16 none a.bit mov1 bt bf btclr set1 clr1 sfr.bit mov1 bt bf btclr set1 clr1 saddr.bit mov1 bt bf btclr set1 clr1 psw.bit mov1 bt bf btclr set1 clr1 [hl].bit mov1 bt bf btclr set1 clr1 cy mov1 and1 or1 xor1 mov1 and1 or1 xor1 mov1 and1 or1 xor1 mov1 and1 or1 xor1 mov1 and1 or1 xor1 set1 clr1 not1
chapter 26 instruction set user?s manual u19180ej1v0ud 739 (4) call instructions/branch instructions call, callf, callt, br, bc, bnc, bz, bnz, bt, bf, btclr, dbnz second operand first operand ax !addr16 !addr11 [addr5] $addr16 basic instruction br call br callf callt br bc bnc bz bnz compound instruction bt bf btclr dbnz (5) other instructions adjba, adjbs, brk, ret, reti, retb, sel, nop, ei, di, halt, stop
user?s manual u19180ej1v0ud 740 chapter 27 electrical specifi cations ((a) grade products) target products: 78k0/fc2: pd78f0881a (a), 78f0882a (a), 78f0883a (a), 78f0884a (a), 78f885a (a), 78f0886a (a), 78f0894a (a), 78f895a (a) 78k0/fe2: pd78f0887a (a), 78f0888a (a), 78f0889a (a), 78f0890a (a) 78k0/ff2: pd78f0891a (a), 78f0892a (a), 78f0893a (a) cautions 1. the 78k0/fx2 microcontrollers have an on-chip debug function, which is provided for development and evaluation. do not use the on-chip debug function in products designated for mass production, because the guaranteed number of rewritable times of the flash memory may be exceeded when this function is u sed, and product reliability therefore cannot be guaranteed. nec electronics is not liable for problems occurring when the on-chip debug function is used. 2. the pins mounted depend on the product as follows. (1) port functions 78k0/fc2 78k0/fe2 78k0/ff2 port 44 pins 48 pins 64 pins 80 pins port 0 p00, p01 p00, p01, p06 p00, p01, p05, p06 port 1 p10 to p17 port 3 p30 to p33 port 4 p40, p41 p40 to p43 p40 to p47 port 5 ? p50 to p53 p50 to p57 port 6 p60 to p62 p60 to p63 p60 to p67 port 7 p70 to p73 p70 to p76 port 8 p80 to p87 port 9 ? p90 p90 to p93 p90 to p97 port 12 p120 to p124 port 13 p130 p130, p131 p130 to p132 (the remaining table is on the next page.)
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 741 (a) grade products (2) non-port functions 78k0/fc2 78k0/fe2 78k0/ff2 port 44 pins 48 pins 64 pins 80 pins power supply, ground v dd , ev dd , v ss , ev ss , av ref , av ss regulator regc reset reset clock oscillation x1, x2, xt1, xt2, exclk, exclks writing to flash memory flmd0 interrupt intp0 to intp7 tm00 ti000, ti010, to00 tm01 ? ti011, to01 ti001, ti011, to01 tm02 ? ti002, ti012, to02 tm03 ? ti003, ti013, to03 tm50 ti50, to50 tm51 ti51, to51 tmh0 toh0 timer tmh1 toh1 uart60 rxd60, txd60 uart61 rxd61, txd61 csi10 sck10, si10, so10 serial interface csi11 ? sck11, si11, so11, ssi11 a/d converter ani0 to ani7 ani0 to ani8 ani0 to ani11 ani0 to ani15 can controller crxd, ctxd clock output pcl buzzer output buz low-voltage detector (lvi) exlvi
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 742 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. 27.1 absolute maximum ratings absolute maximum ratings (t a = 25 c) (1/2) parameter symbol conditions ratings unit v dd ? 0.5 to +6.5 v ev dd ? 0.5 to +6.5 v v ss ? 0.5 to +0.3 v ev ss ? 0.5 to +0.3 v av ref ? 0.5 to v dd +0.3 note v supply voltage av ss ? 0.5 to +0.3 v regc pin input voltage v regc ? 0.5 to +3.6 and v dd v v i1 p00, p01, p05, p06, p10 to p17, p30 to p33, p40 to p47, p50 to p57, p64 to p67, p70 to p76, p80 to p87, p90 to p97, p120, p131, p132, x1, x2, xt1, xt2, reset, flmd0 ? 0.3 to v dd +0.3 note v input voltage v i2 p60 to p63 n-ch open drain ? 0.3 to +6.5 v output voltage v o ? 0.3 to v dd +0.3 note v analog input voltage v an ani0 to ani15 ? 0.3 to av ref +0.3 note and ? 0.3 to v dd +0.3 note v note must be 6.5 v or lower. caution product quality may suffer if the absolute m aximum rating is exceeded ev en momentarily for any parameter. that is, the absolute maximum ratings are rated values at which the product is on the verge of suffering physical damage, and therefore the product must be used under conditions that ensure that the absolute maximum ratings are not exceeded. remark unless specified otherwise, the characteristics of alte rnate-function pins are t he same as those of port pins.
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 743 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. absolute maximum ratings (t a = 25 c) (2/2) parameter symbol conditions ratings unit per pin p00, p01, p05, p06, p10 to p17, p30 to p33, p40 to p47, p50 to p57, p64 to p67, p70 to p76, p120, p130 to p132 ? 10 ma p05, p06, p10 to p17, p30 to p33, p50 to p57, p64 to p67, p70 to p76, p130 ? 55 ma i oh total of all pins ? 80 ma p00, p01, p40 to p47, p120, p131, p132 ? 25 ma per pin ? 0.5 i oh2 total of all pins p80 to p87, p90 to p97 ? 2 ma per pin ? 1 output current, high i oh3 total of all pins p121 to p124 ? 4 ma per pin p00, p01, p05, p06, p10 to p17, p30 to p33, p40 to p47, p50 to p57, p60 to p67, p70 to p76, p120, p130 to p132 30 ma p05, p06, p10 to p17, p30 to p33, p50 to p57, p60 to p67, p70 to p76, p130 140 ma i ol total of all pins 200 ma p00, p01, p40 to p47, p120, p131, p132 60 ma per pin 1 i ol2 all pins p80 to p87, p90 to p97 5 ma per pin 4 output current, low i ol3 all pins p121 to p124 10 ma in normal operation mode ? 40 to +85 operating ambient temperature t a in flash memory programming mode ? 40 to +85 c storage temperature t stg ? 65 to +150 c caution product quality may suffer if the absolute m aximum rating is exceeded ev en momentarily for any parameter. that is, the absolute maximum ratings are rated values at which the product is on the verge of suffering physical damage, and therefore the product must be used under conditions that ensure that the absolute maximum ratings are not exceeded. remark unless specified otherwise, the characteristics of alte rnate-function pins are t he same as those of port pins.
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 744 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. 27.2 oscillator characteristics (1) main system clock (crystal/c eramic) oscillator characteristics (t a = ? 40 to +85 c, 1.8 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) resonator recommended circuit parameter conditions min. typ. max. unit 4.0 v v dd 5.5 v 4.0 20 2.7 v v dd < 4.0 v 4.0 10 ceramic resonator c1 x2 x1 v ss c2 x1 clock oscillation frequency (f x ) note 1.8 v v dd < 2.7 v 4.0 5.0 mhz 4.0 v v dd 5.5 v 4.0 20 2.7 v v dd < 4.0 v 4.0 10 crystal resonator c1 x2 x1 v ss c2 x1 clock oscillation frequency (f x ) note 1.8 v v dd < 2.7 v 4.0 5.0 mhz note indicates only oscillator c haracteristics. refer to ac characteristics for instruction execution time. cautions 1. when using the x1 oscillator, wire as fo llows in the area enclosed by the broken lines in the above figures to avoid an adverse effect from wiring capacitance. ? keep the wiring length as short as possible. ? do not cross the wiring with the other signal lines. ? do not route the wiring near a signal line through which a high fluctuating current flows. ? always make the ground point of the o scillator capacitor the same potential as vss. ? do not ground the capacitor to a ground pattern through which a high current flows. ? do not fetch signals from the oscillator. 2. since the cpu is started by the internal high-speed oscillation cl ock after a reset release, check the x1 clock oscillation stabilization time using the oscillation stabilization time counter status register (ostc) by the user. de termine the oscillation stabilizat ion time of the ostc register and oscillation stabilization time select regist er (osts) after sufficiently evaluating the oscillation stabilization time with the resonator to be used. remark for the resonator selection and oscillator const ant, customers are requested to either evaluate the oscillation themselves or apply to the resonator manufacturer for evaluation.
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 745 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. (2) on-chip internal oscillator characteristics (t a = ? 40 to +85 c, 1.8 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) resonator parameter conditions min. typ. max. unit 2.7 v v dd 5.5 v 7.6 8 8.4 mhz rsts = 1 1.8 v v dd < 2.7 v 7.6 8 10.4 mhz 8 mhz internal oscillator internal high-speed oscillation clock frequency (f rh ) note rsts = 0 2.48 5.6 9.86 mhz 240 khz internal oscillator 2.7 v v dd 5.5 v 216 240 264 khz internal low-speed oscillation clock frequency (f rl ) 1.8 v v dd < 2.7 v 192 240 264 khz note indicates only oscillator characteristics. refer to ac characteristics for instruction execution time. remark rsts: bit 7 of the internal oscillation mode register (rcm) (3) subsystem clock o scillator characteristics (t a = ? 40 to +85 c, 1.8 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) resonator recommended circuit parameter conditions min. typ. max. unit crystal resonator xt1 v ss xt2 c4 c3 rd xt1 clock oscillation frequency (f xt ) note 32 32.768 35 khz note indicates only oscillator c haracteristics. refer to ac characteristics for instruction execution time. cautions 1. when using the xt1 oscillator, wire as follows in the area enclosed by the broken lines in the above figures to avoid an adverse effect from wiring capacitance. ? keep the wiring length as short as possible. ? do not cross the wiring with the other signal lines. ? do not route the wiring near a signal line through which a high fluctuating current flows. ? always make the ground point of the osci llator capacitor the same potential as vss. ? do not ground the capacitor to a ground pattern through which a high current flows. ? do not fetch signals from the oscillator. 2. the xt1 oscillator is designed as a low-amplitude circuit for reducing power consumption, and is more prone to malfunc tion due to noise than the x1 oscillato r. particular care is therefore required with the wiring method when the xt1 clock is used. remark for the resonator selection and oscillator const ant, customers are requested to either evaluate the oscillation themselves or apply to the resonator manufacturer for evaluation.
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 746 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. 27.3 dc characteristics dc characteristics (1/6) (t a = ? 40 to +85 c, 1.8 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit 4.0 v v dd 5.5 v ? 3.0 ma 2.7 v v dd < 4.0 v ? 2.5 ma per pin for p00, p01, p05, p06, p10 to p17, p30 to p33, p40 to p47, p50 to p57, p64 to p67, p70 to p76, p120, p130 to p132 1.8 v v dd < 2.7 v ? 1.0 ma 4.0 v v dd 5.5 v ? 18.0 ma 2.7 v v dd < 4.0 v ? 15.0 ma total of pins note 2 p05, p06, p10 to p17, p30 to p33, p50 to p57, p64 to p67, p70 to p76, p130 1.8 v v dd < 2.7 v ? 10.0 ma 4.0 v v dd 5.5 v ? 12.0 ma 2.7 v v dd < 4.0 v ? 7.0 ma total of pins note 2 p00, p01, p40 to p47, p120, p131, p132 1.8 v v dd < 2.7 v ? 5.0 ma 4.0 v v dd 5.5 v ? 23.0 ma 2.7 v v dd < 4.0 v ? 18.0 ma output current, high note 1 i oh1 total of pins note 2 1.8 v v dd < 2.7 v ? 15.0 ma i oh2 per pin for p80 to p87, p90 to p97 av ref = v dd ? 100 a per pin for p121 to p124 notes 1. value of current at which the device operation is guaranteed even if t he current flows from v dd to an output pin. 2. specification under conditions wh ere the duty factor is 70% (time for which current is output is 0.7 t and time for which current is not output is 0.3 t, where t is a specific time). the total output current of the pins at a duty factor of other than 70% can be calculated by the following expression. ? where the duty factor of i oh is n%: total output current of pins = (i oh 0.7) / (n 0.01) where the duty factor is 50%, i oh = 20.0 ma total output current of pins = (20.0 0.7) / (50 0.01) = 28.0 ma however, the current that is allowed to flow into one pin does not vary depending on the duty factor. a current higher than the absolute maximum rating must not flow into one pin. remark unless specified otherwise, the characteristics of alter nate-function pins are the sa me as those of port pins. high level output current and low level current are the spec in duty = 70% conditions.
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 747 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. dc characteristics (2/6) (t a = ? 40 to +85 c, 1.8 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit 4.0 v v dd 5.5 v 8.5 ma 2.7 v v dd < 4.0 v 5.0 ma per pin for p00, p01, p05, p06, p10 to p17, p30 to p33, p40 to p47, p50 to p57, p64 to p67, p70 to p76, p120, p130 to p132 1.8 v v dd < 2.7 v 2.0 ma 4.0 v v dd 5.5 v 15 ma 2.7 v v dd < 4.0 v 5.0 ma per pin for p60 to p63 1.8 v v dd < 2.7 v 2.0 ma 4.0 v v dd 5.5 v 45.0 ma 2.7 v v dd < 4.0 v 35.0 ma total of pins note 2 p05, p06, p10 to p17, p30 to p33, p50 to p57, p60 to p67, p70 to p76, p130 1.8 v v dd < 2.7 v 20.0 ma 4.0 v v dd 5.5 v 20.0 ma 2.7 v v dd < 4.0 v 15.0 ma total of pins note 2 p00, p01, p40 to p47, p120, p131, p132 1.8 v v dd < 2.7 v 9.0 ma 4.0 v v dd 5.5 v 65.0 ma 2.7 v v dd < 4.0 v 50.0 ma output current, low note 1 i ol1 total of pins note 2 1.8 v v dd < 2.7 v 29.0 ma i ol2 per pin for p80 to p87, p90 to p97 av ref = v dd 400 a per pin for p121 to p124 notes 1. value of current at which the devic e operation is guaranteed even if the current flow s from an output pin to gnd. 2. specification under conditions wh ere the duty factor is 70% (time for which current is output is 0.7 t and time for which current is not output is 0.3 t, where t is a specific time). the total output current of the pins at a duty factor of other than 70% can be calculated by the following expression. ? where the duty factor of i oh is n%: total output current of pins = (i oh 0.7) / (n 0.01) where the duty factor is 50%, i oh = 20.0 ma total output current of pins = (20.0 0.7) / (50 0.01) = 28.0 ma however, the current that is allowed to flow into one pin does not vary depending on the duty factor. a current higher than the absolute maximum rating must not flow into one pin. remark unless specified otherwise, the characteristics of alter nate-function pins are the sa me as those of port pins. high level output current and low level current are the spec in duty = 70% conditions.
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 748 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. dc characteristics (3/6) (t a = ? 40 to +85 c, 1.8 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit v ih1 p12, p13, p15, p40 to p47, p50 to p57, p64 to p67, p70, p74, p121-p124 0.7v dd v dd v v ih2 p00, p01, p05, p06, p10, p11, p14, p16, p17, p30 to p33, p71 to p73, p75, p76, p120, p131, p132, reset, exclk, exclks 0.8v dd v dd v v ih3 p80 to p87, p90 to p97 av ref = v dd 0.7av ref av ref v input voltage, high v ih4 p60 to p63 0.7v dd 6.0 v v il1 p12, p13, p15, p40 to p47, p50 to p57, p60 to p67, p70, p74, p121 to p124 0 0.3v dd v v il2 p00, p01, p05, p06, p10, p11, p14, p16, p17, p30 to p33, p71, p72, p73, p75, p76, p120, p131, p132, reset, exclk, exclks 0 0.2v dd v input voltage, low v il3 p80 to p87, p90 to p97 av ref = v dd 0 0.3av ref v i oh = ? 3.0 ma 4.0 v v dd 5.5 v v dd ? 0.7 v i oh = ? 2.5 ma 2.7 v v dd < 4.0 v v dd ? 0.5 v v oh1 i oh = ? 1.0 ma p00, p01, p05, p06, p10 to p17, p30 to p33, p40 top47, p50 to p57, p64 to p67, p70 to p76, p120, p130 to p132 1.8 v v dd < 2.7 v v dd ? 0.5 v i oh = ? 100 a p80 to p87, p90 to p97 av ref = v dd v dd ? 0.5 v output voltage, high v oh2 p121 to p124 i ol = 8.5 ma 4.0 v v dd 5.5 v 0.7 v i ol = 5.0 ma 2.7 v v dd < 4.0 v 0.7 v i ol = 2.0 ma 1.8 v v dd < 2.7 v 0.5 v i ol = 1.0 ma 1.8 v v dd < 2.7 v 0.5 v v ol1 i ol = 0.5 ma p00, p01, p05, p06, p10 to p17, p30 to p33, p40 top47, p50 to p57, p64 to p67, p70 to p76, p120, p130 to p132 1.8 v v dd < 2.7 v 0.4 v p80 to p87, p90 to p97 av ref = v dd 0.4 v ol2 i ol = 400 a p121 to p124 v i ol = 15 ma p60 to p63 4.0 v v dd 5.5 v 2.0 v i ol = 5.0 ma 0.4 v i ol = 5.0 ma 2.7 v v dd < 4.0 v 0.6 v i ol = 3.0 ma 2.7 v v dd < 4.0 v 0.4 v output voltage, low v ol3 i ol = 2.0 ma 1.8 v v dd < 2.7 v 0.4 v remark unless specified otherwise, the charac teristics of alternate-function pins are the same as those of port pins.
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 749 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. dc characteristics (4/6) (t a = ? 40 to +85 c, 1.8 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit i lih1 v i = v dd p00, p01, p05, p06, p10 to p17, p30 to p33, p40 to p47, p50 to p57, p60 to p67, p70 to p76, p120, p131, p132, reset, flmd0 1 a i lih2 v i = av ref p80 to p87, p90 to p97 av ref = v dd 1 a i lih3 v i = v dd p121 to p124 i/o port mode 1 a input leakage current, high (x1, x2, xt1, xt2) osc port mode 20 a i lil1 v i = v ss p00, p01, p05, p06, p10 to p17, p30 to p33, p40 to p47, p50 to p57, p60 to p67, p70 to p76, p120, p131, p132, reset, flmd0 ? 1 a i lil2 p80 to p87, p90 to p97 av ref = v dd ? 1 a i lil3 p121 to p124 i/o port mode ? 1 a input leakage current, low (x1, x2, xt1, xt2) osc port mode ? 20 a pull-up resistor r u v i = v ss 10 20 100 k flmd0 supply voltage v il in normal operation mode 0 0.2v dd v v ih in self programming mode 0.8 v dd v dd v remark unless specified otherwise, the characteristics of alter nate-function pins are the sa me as those of port pins.
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 750 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. dc characteristics (5/6) (t a = ? 40 to +85 c, 1.8 v v dd = ev dd 5.5 v, 2.3 v av ref v dd , v ss = ev ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit square wave input 3.4 6.8 f xh = 20 mhz note 2 , v dd = 5.0 v resonator connection 4.7 8.2 ma square wave input 1.8 3.6 f xh = 10 mhz notes 2, 3 , v dd = 5.0 v resonator connection 2.5 4.7 ma square wave input 1.7 3.5 f xh = 10 mhz notes 2, 3 , v dd = 3.0 v resonator connection 2.4 4.0 ma square wave input 1.0 2.0 f xh = 5 mhz notes 2, 3 , v dd = 3.0 v resonator connection 1.4 2.4 ma square wave input 0.8 1.7 f xh = 5 mhz notes 2, 3 , v dd = 2.0 v resonator connection 1.1 1.9 ma f rh = 8 mhz note 4 , v dd = 5.0 v 1.5 2.7 ma square wave input 6 30 i dd1 operating mode f sub = 32.768 khz note 5 , v dd = 5.0 v resonator connection 15 35 a square wave input 1.0 3.9 f xh = 20 mhz note 2 , v dd = 5.0 v resonator connection 2.2 5.7 ma square wave input 0.6 2.0 f xh = 10 mhz notes 2, 3 , v dd = 5.0 v resonator connection 1.2 3.1 ma square wave input 0.3 1.0 f xh = 5 mhz notes 2, 3 , v dd = 3.0 v resonator connection 0.6 1.5 ma f rh = 8 mhz note 4 , v dd = 5.0 v 0.5 1.4 ma square wave input 3.0 27 i dd2 halt mode f sub = 32.768 khz note 5 , v dd = 5.0 v resonator connection 12 32 a supply current note 1 i dd3 note 6 stop mode v dd = 5.0 v 1 20 a notes 1. total current flowing into the internal power supply (v dd , ev dd ), including the peripheral operation current and the input leakage current flowing when t he level of the input pin are fixed to v dd or v ss . however, the current flowing into the pull-up resistors and t he output current of the port is not included. 2. not including the operating current of the 8 mhz inte rnal oscillator, xt1 oscillation, 240 khz internal oscillator and the current flowing into the a/d converter, watchdog timer and lvi circuit. 3. when amph (bit 0 of clock operation mode select register (oscctl)) = 0. 4. not including the operating current of the x1 oscillation, xt1 oscillation and 240 khz internal oscillator. not including the current flowing into the a/d converte r, watchdog timer, lvi circuit and can controller. 5. not including the operating current of the x1 oscill ation, 8 mhz internal oscillator and 240 khz internal oscillator, and the current flowing into the a/ d converter, watchdog timer and lvi circuit. 6. not including the operating current of the 240 khz internal oscillator and xt1 oscillation, and the current flowing into the a/d converter, watchdog timer and lvi circuit. remarks 1. f xh : high-speed system clock frequency (x1 clock o scillation frequency or external main system clock frequency) 2. f rh : internal high-speed oscillation clock frequency 3. f sub : subsystem clock frequency (xt1 clock oscillation frequency or external subsystem clock frequency)
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 751 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. dc characteristics (6/6) (t a = ? 40 to +85 c, 1.8 v v dd = ev dd 5.5 v, 2.3 v av ref v dd , v ss = ev ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit a/d converter operating current i adc note 1 adce = 1 2.3 v av ref v dd 0.86 1.9 ma watchdog timer operating current i wdt note 2 during 240 khz internal low-speed oscillation clock operation 5 10 a lvi operating current i lvi note 3 9 18 a notes 1. current flowing only to the a/d converter (av ref -pin). the current value of the 78k0/fx2 microcontrollers is the sum of i dd1 or i dd2 and i adc when the a/d converter operates in an operation mode or the halt mode. 2. current flowing only to the watchdog timer (v dd -pin) (including the operating current of the 240 khz internal oscillator). the current value of the 78k0/fx2 microcontrollers is the sum of i dd2 or i dd3 and iwdt when the watchdog timer operates in the halt or stop mode. 3. current flowing only to the lvi circuit (v dd -pin). the current value of the 78k0/fx2 microcontrollers is the sum of i dd2 or i dd3 and ilvi when the lvi circuit operat es in the halt or stop mode.
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 752 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. 27.4 ac characteristics (1) basic operation (t a = ? 40 to +85 c, 1.8 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit 4.0 v v dd 5.5 v 0.1 8 2.7 v v dd < 4.0 v 0.2 8 main system clock (f xp ) operation 1.8 v v dd < 2.7 v 0.4 note 1 8 s instruction cycle (minimum instruction execution time) t cy subsystem clock (f sub ) operation 114 122 125 s 4.0 v v dd 5.5 v 20 2.7 v v dd < 4.0 v 10 f prs = f xh 1.8 v v dd < 2.7 v 5 mhz 2.7 v v dd 5.5 v 7.6 8.4 peripheral hardware clock frequency f prs f prs = f rh 1.8 v v dd < 2.7 v note 2 7.6 10.4 mhz 4.0 v v dd 5.5 v 4.0 20 2.7 v v dd < 4.0 v 4.0 10 external main system clock frequency f ext 1.8 v v dd < 2.7 v 4.0 5 mhz 4.0 v v dd 5.5 v 24 2.7 v v dd < 4.0 v 48 external clock input high level width, low level width f exth , f extl 1.8 v v dd < 2.7 v 96 ns external subsystem clock frequency f exts 32 32.768 35 khz external sub clock input high level width, low level width f extsh , f extsl 12 s 4.0 v v dd 5.5 v 2/f sam + 0.1 note 3 s 2.7 v v dd < 4.0 v 2/f sam + 0.2 note 3 s ti000, ti001, ti002, ti003, ti010, ti011 ti012, ti013 input high-level width, low-level width t tih0 , t til0 1.8 v v dd < 2.7 v 2/f sam + 0.5 note 3 s 4.0 v v dd 5.5 v 10 mhz 2.7 v v dd < 4.0 v 10 mhz ti50, ti51 input frequency f ti5 1.8 v v dd < 2.7 v 5 mhz 4.0 v v dd 5.5 v 50 ns 2.7 v v dd < 4.0 v 50 ns ti50, ti51 input high-level width, low-level width t tih5 , t til5 1.8 v v dd < 2.7 v 100 ns interrupt input high-level width, low-level width t inih , t inil 1 s reset low-level width t rsl 10 s notes 1. 0.38 s when operating with the 8 mhz internal oscillator. 2. this spec is a definition of the ma in system clock. therefore, perip heral hardware must use the clock of f rh /2 or less. (v dd = 1.8 v or less) 3. selection of f sam = f prs , f prs /4, f prs /256, or f prs , f prs /16, f prs /64 is possible using bits 0 and 1 (prm0n0, prm0n1) of prescaler mode registers 0n (prm0n). note that when selecting the ti00n valid edge as the count clock, f sam = f prs (n = 0 to 3).
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 753 (a) grade products t cy vs. v dd (main system clock operation) supply voltage v dd [v] cycle time t cy [ s] 5.0 1.0 2.0 0.4 0.2 0.1 0 10.0 1.0 2.0 3.0 4.0 5.0 6.0 5.5 1.8 20.0 8.0 2.7 guaranteed operation range (the gray portion is applicable only if amph = 1 is set.)
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 754 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. ac timing test points (excluding x1, xt1) v ih v il test points v ih v il external clock input timing exclk 0.8v dd 0.2v dd 1/f ext t extl t exth 1/f exts t extsl t extsh exclks 0.8v dd 0.2v dd ti timing ti000, ti001, ti002, ti003, ti010, ti011, ti012, ti013 t til0 t tih0 ti50, ti51 1/f ti5 t til5 t tih5
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 755 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. reset input timing reset t rsl (2) serial interface (t a = ? 40 to +85 c, 1.8 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) (a) uart mode (uart6n, dedicated baud rate generator output) parameter symbol conditions min. typ. max. unit transfer rate 625 kbps (b) 3-wire serial i/o mode (master mode, sck1n... internal clock output) parameter symbol conditions min. typ. max. unit 4.0 v v dd 5.5 v 200 ns 2.7 v v dd < 4.0 v 400 ns sck1n cycle time t kcy1 1.8 v v dd < 2.7 v 600 ns 4.0 v v dd 5.5 v t kcy1 /2 ? 20 ns 2.7 v v dd < 4.0 v t kcy1 /2 ? 30 ns sck1n high-/low-level width note 1 t kh1 , t kl1 1.8 v v dd < 2.7 v t kcy1 /2 ? 60 ns 4.0 v v dd 5.5 v 70 ns 2.7 v v dd < 4.0 v 100 ns si1n setup time (to sck1n ) t sik1 1.8 v v dd < 2.7 v 190 ns si1n hold time (from sck1n ) t ksi1 30 ns delay time from sck1n to so1n output t kso1 c = 50 pf note 2 40 ns notes 1. it is value at the time of fx use. keep in mind that spec different at the time of fosc8 use. 2. c is the load capacitance of the sck1n and so1n output lines. (c) 3-wire serial i/o mode (slave mode, sck1n... external clock input) parameter symbol conditions min. typ. max. unit sck1n cycle time t kcy2 400 ns sck1n high-/low-level width t kh2 , t kl2 t kcy2 /2 ns si1n setup time (to sck1n ) t sik2 80 ns si1n hold time (from sck1n ) t ksi2 50 ns 4.0 v v dd 5.5 v 120 2.7 v v dd < 4.0 v 120 delay time from sck1n to so1n output t kso2 c = 50 pf note 1.8 v v dd < 2.7 v 180 ns note c is the load capacitance of the so1n output line. remark n = 0, 1
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 756 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. serial transfer timing 3-wire serial i/o mode: si1n so1n t kcym t klm t khm t sikm t ksim input data t ksom output data sck1n remark m = 1, 2 n = 0, 1
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 757 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. (3) can controller (t a = ? 40 to +85 c, 1.8 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit transfer rate 1 mbps internal delay time t node 100 ns can internal clock ctxd pin (transfer data) crxd pin (receive data) t output t input note internal delay time (t node ) = internal transfer delay (t output ) + internal receive delay (t input ) note can internal clock (f can ): can baud rate clock image figure of internal delay 78k0/fx2 microcontrollers ctxd pin crxd pin can macro internal receive delay internal transfer delay
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 758 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. (4) a/d converter characteristics (t a = ? 40 to +85 c, 2.3 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit resolution res 10 bit 4.0 v av ref 5.5 v 0.4 2.7 v av ref < 4.0 v 0.6 overall error notes 1, 2 a inl 2.3 v av ref < 2.7 v 1.2 %fsr 4.0 v av ref 5.5 v 6.1 66.6 2.7 v av ref < 4.0 v 12.2 66.6 conversion time t conv 2.3 v av ref < 2.7 v 27 66.6 s 4.0 v av ref 5.5 v 0.4 2.7 v av ref < 4.0 v 0.6 zero-scale error notes 1, 2 e zs 2.3 v av ref < 2.7 v 0.6 %fsr 4.0 v av ref 5.5 v 0.4 2.7 v av ref < 4.0 v 0.6 full-scale error notes 1, 2 e fs 2.3 v av ref < 2.7 v 0.6 %fsr 4.0 v av ref 5.5 v 2.5 2.7 v av ref < 4.0 v 4.5 integral non-linearity error note 1 i le 2.3 v av ref < 2.7 v 6.5 lsb 4.0 v av ref 5.5 v 1.5 2.7 v av ref < 4.0 v 2.0 differential non-linearity error note 1 d le 2.3 v av ref < 2.7 v 2.0 lsb analog input voltage v ain 2.3 v av ref 5.5 v av ss av ref v notes 1. excludes quantization error ( 1/2 lsb). 2. this value is indicated as a ratio (%fsr) to the full-scale value.
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 759 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. (5) poc circuit characteristics (t a = ? 40 to +85 c, v ss = 0 v) parameter symbol conditions min. typ. max. unit detection voltage v poc0 1.44 1.59 1.74 v power supply rise time t pth v dd : 0 v v poc0 0.5 v/ms minimum pulse width t pw 200 s poc circuit timing supply voltage (v dd ) time detection voltage (min.) detection voltage (typ.) detection voltage (max.) t pw t pth
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 760 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. (6) lvi circuit characteristics (t a = ? 40 to +85 c, v poc v dd = ev dd 5.5 v, av ref v dd , v ss = ev ss = 0 v) parameter symbol conditions min. typ. max. unit v lvi0 4.14 4.24 4.34 v v lvi1 3.99 4.09 4.19 v v lvi2 3.83 3.93 4.03 v v lvi3 3.68 3.78 3.88 v v lvi4 3.52 3.62 3.72 v v lvi5 3.37 3.47 3.57 v v lvi6 3.22 3.32 3.42 v v lvi7 3.06 3.16 3.26 v v lvi8 2.91 3.01 3.11 v v lvi9 2.75 2.85 2.95 v v lvi10 2.60 2.70 2.80 v v lvi11 2.45 2.55 2.65 v v lvi12 2.29 2.39 2.49 v v lvi13 2.14 2.24 2.34 v v lvi14 1.98 2.08 2.18 v supply voltage level v lvi15 1.83 1.93 2.03 v external input pin note 1 ex lvi ex lvi < v dd , 1.8 v v dd 5.5 v 1.11 1.21 1.31 v detection voltage detection voltage on application of supply voltage vdd lvi lvistart (option bye) = 1 2.50 2.70 2.90 v minimum pulse width t lw 200 s operation stabilization wait time note 2 t lwait1 10 s notes 1. external input pin is alternate p120/intp pin. 2. time required from setting lvion to 1 to operation stabilization. remark v lvi (n ? 1) > v lvin (n = 1 to 15) lvi circuit timing supply voltage (v dd ) time detection voltage (min.) detection voltage (typ.) detection voltage (max.) t lwait1 t lw lvion 1
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 761 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. (7) power supply starting time (t a = ? 40 to +85 c, v ss = 0 v) parameter symbol conditions min. typ. max. unit starting maximum time to v dd min (1.8 v) note1 (v dd : 0 v 1.8 v) t pup1 lvi starting option invalid when pin reset intact 3.6 ms starting maximum time to v dd min (1.8 v) note1 (pin reset release v dd : 1.8 v) t pup2 lvi starting option invalid when pin reset use 1.9 ms notes 1. start a power supply in time shorter t han this when lvi staring option invalid. 2. it is base on the spec of poc. 1.8 v 0 v poc t pup1 v dd 1.8 v 0 v poc t pup2 v dd reset pin pin reset intact pin reset use
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 762 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. 27.5 data retention characteristics data memory stop mode low supply vo ltage data retention characteristics (t a = ? 40 to +85 c) parameter symbol conditions min. typ. max. unit data retention supply voltage v dddr 1.44 note 5.5 v note the value depends on the poc det ection voltage. when the voltage drop s, the data is retained until a poc reset is effected, but data is not re tained when a poc reset is effected. data retention timing v dddr data retention characteristics v dd stop instruction execution stop mode standby release signal (interrupt request) operation
chapter 27 electrical specifications ((a) grade products) user?s manual u19180ej1v0ud 763 (a) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. 27.6 flash eeprom programming characteristics (1) basic characteristics (t a = ? 40 to +85 c, 2.7 v v dd = ev dd 5.5 v, v ss = ev ss = 0 v) parameter symbol conditions min. typ. max. unit v dd supply current i dd f xp = 10 mhz (typ.), 20 mhz (max.) 4.5 11.0 ma all block t eraca 20 200 ms erase time notes 1, 2 block unit t erasa 20 200 ms write time (in 8-bit units) note 1 t wrwa 10 100 s when a flash memory programmer is used, and the libraries note 4 provided by nec electronics are used 15 years 1000 times when the eeprom emulation libraries note 5 provided by nec electronics are used, and the rewritable rom size is 4 kb 5 years 10000 times number of rewrites per chip c erwr 1 erase + 1 write after erase = 1 rewrite note 3 conditions other than the above note 6 10 years 100 times notes 1. characteristic of the flash memory. for the char acteristic when a dedicated flash memory programmer, pg-fp4 or pg-fp5, is used and the rewr ite time during self programming, see tables 24-15 to 24-17 . 2. the prewrite time before erasure and the erase verify time (writeback time) are not included. 3. when a product is first written after shipment, ?erase write? and ?write only? are both taken as one rewrite.
user?s manual u19180ej1v0ud 764 chapter 28 electrical specifi cations ((a2) grade products) target products: 78k0/fc2: pd78f0881a (a2), 78f0882a (a2), 78f0883a (a2), 78f0884a (a2), 78f885a (a2), 78f0886a (a2), 78f0894a (a2), 78f895a (a2) 78k0/fe2: pd78f0887a (a2), 78f0888a (a2), 78f0889a (a2), 78f0890a (a2) 78k0/ff2: pd78f0891a (a2), 78f0892a (a2), 78f0893a (a2) cautions 1. the 78k0/fx2 microcontrollers have an on-chip debug function, which is provided for development and evaluation. do not use the on-chip debug function in products designated for mass production, because the guaranteed number of rewritable times of the flash memory may be exceeded when this function is u sed, and product reliability therefore cannot be guaranteed. nec electronics is not liable for problems occurring when the on-chip debug function is used. 2. the pins mounted depend on the product as follows. (1) port functions 78k0/fc2 78k0/fe2 78k0/ff2 port 44 pins 48 pins 64 pins 80 pins port 0 p00, p01 p00, p01, p06 p00, p01, p05, p06 port 1 p10 to p17 port 3 p30 to p33 port 4 p40, p41 p40 to p43 p40 to p47 port 5 ? p50 to p53 p50 to p57 port 6 p60 to p62 p60 to p63 p60 to p67 port 7 p70 to p73 p70 to p76 port 8 p80 to p87 port 9 ? p90 p90 to p93 p90 to p97 port 12 p120 to p124 port 13 p130 p130, p131 p130 to p132 (the remaining table is on the next page.)
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 765 (a2) grade products (2) non-port functions 78k0/fc2 78k0/fe2 78k0/ff2 port 44 pins 48 pins 64 pins 80 pins power supply, ground v dd , ev dd , v ss , ev ss , av ref , av ss regulator regc reset reset clock oscillation x1, x2, xt1, xt2, exclk, exclks writing to flash memory flmd0 interrupt intp0 to intp7 tm00 ti000, ti010, to00 tm01 ? ti011, to01 ti001, ti011, to01 tm02 ? ti002, ti012, to02 tm03 ? ti003, ti013, to03 tm50 ti50, to50 tm51 ti51, to51 tmh0 toh0 timer tmh1 toh1 uart60 rxd60, txd60 uart61 rxd61, txd61 csi10 sck10, si10, so10 serial interface csi11 ? sck11, si11, so11, ssi11 a/d converter ani0 to ani7 ani0 to ani8 ani0 to ani11 ani0 to ani15 can controller crxd, ctxd clock output pcl buzzer output buz low-voltage detector (lvi) exlvi
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 766 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. 28.1 absolute maximum ratings absolute maximum ratings (t a = 25 c) (1/2) parameter symbol conditions ratings unit v dd ? 0.5 to +6.5 v ev dd ? 0.5 to +6.5 v v ss ? 0.5 to +0.3 v ev ss ? 0.5 to +0.3 v av ref ? 0.5 to v dd +0.3 note v supply voltage av ss ? 0.5 to +0.3 v regc pin input voltage v regc ? 0.5 to +3.6 and v dd v v i1 p00, p01, p05, p06, p10 to p17, p30 to p33, p40 to p47, p50 to p57, p64 to p67, p70 to p76, p80 to p87, p90 to p97, p120, p131, p132, x1, x2, xt1, xt2, reset, flmd0 ? 0.3 to v dd +0.3 note v input voltage v i2 p60 to p63 n-ch open drain ? 0.3 to +6.5 v output voltage v o ? 0.3 to v dd +0.3 note v analog input voltage v an ani0 to ani15 ? 0.3 to av ref +0.3 note and ? 0.3 to v dd +0.3 note v per pin p00, p01, p05, p06, p10 to p17, p30 to p33, p40 to p47, p50 to p57, p64 to p67, p70 to p76, p120, p130, p131, p132 ? 10 ma p05, p06, p10 to p17, p30 to p33, p50 to p57, p64 to p67, p70 to p76, p130 ? 55 ma i oh total of all pins ? 80 ma p00, p01, p40 to p47, p120, p131, p132 ? 25 ma per pin ? 0.5 i oh2 total of all pins p80 to p87, p90 to p97 ? 2 ma per pin ? 1 output current, high i oh3 total of all pins p121 to p124 ? 4 ma note must be 6.5 v or lower. caution product quality may suffer if the absolute m aximum rating is exceeded ev en momentarily for any parameter. that is, the absolute maximum ratings are rated values at which the product is on the verge of suffering physical damage, and therefore the product must be used under conditions that ensure that the absolute maximum ratings are not exceeded. remark unless specified otherwise, the characteristics of alte rnate-function pins are t he same as those of port pins.
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 767 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. absolute maximum ratings (t a = 25 c) (2/2) parameter symbol conditions ratings unit per pin p00, p01, p05, p06, p10 to p17, p30 to p33, p40 to p47, p50 to p57, p60 to p67, p70 to p76, p120, p130, p131, p132 30 ma p05, p06, p10 to p17, p30 to p33, p50 to p57, p60 to p67, p70 to p76, p130 140 ma i ol total of all pins 200 ma p00, p01, p40 to p47, p120, p131, p132 60 ma per pin 1 i ol2 all pins p80 to p87, p90 to p97 5 ma per pin 4 output current, low i ol3 all pins p121 to p124 10 ma in normal operation mode ? 40 to +125 operating ambient temperature t a in flash memory programming mode ? 40 to +125 c storage temperature t stg ? 65 to +150 c caution product quality may suffer if the absolute m aximum rating is exceeded ev en momentarily for any parameter. that is, the absolute maximum ratings are rated values at which the product is on the verge of suffering physical damage, and therefore the product must be used under conditions that ensure that the absolute maximum ratings are not exceeded. remark unless specified otherwise, the characteristics of alte rnate-function pins are t he same as those of port pins.
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 768 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. 28.2 oscillator characteristics (1) main system clock (crystal/c eramic) oscillator characteristics (t a = ? 40 to +125 c, 2.7 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) resonator recommended circuit parameter conditions min. typ. max. unit 4.0 v v dd 5.5 v 4.0 20 ceramic resonator c1 x2 x1 v ss c2 x1 clock oscillation frequency (f x ) note 2.7 v v dd < 4.0 v 4.0 10 mhz 4.0 v v dd 5.5 v 4.0 20 crystal resonator c1 x2 x1 v ss c2 x1 clock oscillation frequency (f x ) note 2.7 v v dd < 4.0 v 4.0 10 mhz note indicates only oscillator characteristics. refer to ac characteristics for instruction execution time. cautions 1. when using the x1 oscillator, wire as fo llows in the area enclosed by the broken lines in the above figures to avoid an adverse effect from wiring capacitance. ? keep the wiring length as short as possible. ? do not cross the wiring with the other signal lines. ? do not route the wiring near a signal line through which a high fluctuating current flows. ? always make the ground point of the o scillator capacitor the same potential as v ss . ? do not ground the capacitor to a ground pattern through which a high current flows. ? do not fetch signals from the oscillator. 2. since the cpu is started by the internal high-speed oscillation cl ock after a reset release, check the x1 clock oscillation stabilization time using the oscillation stabilization time counter status register (ostc) by the user. de termine the oscillation stabilizat ion time of the ostc register and oscillation stabilization time select regist er (osts) after sufficiently evaluating the oscillation stabilization time with the resonator to be used. remark for the resonator selection and oscillator const ant, customers are requested to either evaluate the oscillation themselves or apply to the resonator manufacturer for evaluation.
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 769 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. (2) on-chip internal oscillator characteristics (t a = ? 40 to +125 c, 2.7 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) resonator parameter conditions min. typ. max. unit rsts = 1 2.7 v v dd 5.5 v 7.6 8 8.46 mhz 8 mhz internal oscillator internal high-speed oscillation clock frequency (f rh ) note rsts = 0 2.48 5.6 9.86 mhz 240 khz internal oscillator internal low-speed oscillation clock frequency (f rl ) 2.7 v v dd 5.5 v 216 240 264 khz note indicates only oscillator characteristics. refer to ac characteristics for instruction execution time. remark rsts: bit 7 of the internal oscillation mode register (rcm) (3) subsystem clock o scillator characteristics (t a = ? 40 to +125 c, 2.7 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) resonator recommended circuit parameter conditions min. typ. max. unit crystal resonator xt1 v ss xt2 c4 c3 rd xt1 clock oscillation frequency (f xt ) note 32 32.768 35 khz note indicates only oscillator c haracteristics. refer to ac characteristics for instruction execution time. cautions 1. when using the xt1 oscillator, wire as follows in the area enclosed by the broken lines in the above figures to avoid an adverse effect from wiring capacitance. ? keep the wiring length as short as possible. ? do not cross the wiring with the other signal lines. ? do not route the wiring near a signal line through which a high fluctuating current flows. ? always make the ground point of the o scillator capacitor the same potential as v ss . ? do not ground the capacitor to a ground pattern through which a high current flows. ? do not fetch signals from the oscillator. 2. the xt1 oscillator is designed as a low-amplitude circuit for reducing power consumption, and is more prone to malfunc tion due to noise than the x1 oscillato r. particular care is therefore required with the wiring method when the xt1 clock is used. remark for the resonator selection and oscillator const ant, customers are requested to either evaluate the oscillation themselves or apply to the resonator manufacturer for evaluation.
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 770 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. 28.3 dc characteristics dc characteristics (1/6) (t a = ? 40 to +125 c, 2.7 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit 4.0 v v dd 5.5 v ? 1.5 ma per pin for p00, p01, p05, p06, p10 to p17, p30 to p33, p40 to p47, p50 to p57, p64 to p67, p70 to p76, p120, p130 to p132 2.7 v v dd < 4.0 v ? 1.0 ma 4.0 v v dd 5.5 v ? 10.0 ma total of pins note 2 p05, p06, p10 to p17, p30 to p33, p50 to p57, p64 to p67, p70 to p76, p130 2.7 v v dd < 4.0 v ? 8.0 ma 4.0 v v dd 5.5 v ? 6.0 ma total of pins note 2 p00, p01, p40 to p47, p120, p131, p132 2.7 v v dd < 4.0 v ? 4.0 ma 4.0 v v dd 5.5 v ? 14.0 ma output current, high note 1 i oh1 total of pins note 2 2.7 v v dd < 4.0 v ? 12.0 ma i oh2 per pin for p80 to p87, p90 to p97 av ref = v dd ? 100 a per pin for p121 to p124 notes 1. value of current at which the device operation is guaranteed even if t he current flows from v dd to an output pin. 2. specification under conditions wh ere the duty factor is 70% (time for which current is output is 0.7 t and time for which current is not output is 0.3 t, where t is a specific time). the total output current of the pins at a duty factor of other than 70% can be calculated by the following expression. ? where the duty factor of i oh is n%: total output current of pins = (i oh 0.7) / (n 0.01) where the duty factor is 50%, i oh = 20.0 ma total output current of pins = (20.0 0.7) / (50 0.01) = 28.0 ma however, the current that is allowed to flow into one pin does not vary depending on the duty factor. a current higher than the absolute maximum rating must not flow into one pin. remark unless specified otherwise, the characteristics of alter nate-function pins are the sa me as those of port pins.
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 771 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. dc characteristics (2/6) (t a = ? 40 to +125 c, 2.7 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit 4.0 v v dd 5.5 v 4.0 ma per pin for p00, p01, p05, p06, p10 to p17, p30 to p33, p40 to p47, p50 to p57, p64 to p67, p70 to p76, p120, p130 to p132 2.7 v v dd < 4.0 v 2.0 ma 4.0 v v dd 5.5 v 8.0 ma per pin for p60 to p63 2.7 v v dd < 4.0 v 2.0 ma 4.0 v v dd 5.5 v 20.0 ma total of pins note 2 p05, p06, p10 to p17, p30 to p33, p50 to p57, p60 to p67, p70 to p76, p130 2.7 v v dd < 4.0 v 16.0 ma 4.0 v v dd 5.5 v 10.0 ma total of pins note 2 p00, p01, p40 to p47, p120, p131, p132 2.7 v v dd < 4.0 v 8.0 ma 4.0 v v dd 5.5 v 30.0 ma output current, low note 1 i ol1 total of pins note 2 2.7 v v dd < 4.0 v 24.0 ma i ol2 per pin for p80 to p87, p90 to p97 av ref = v dd 400 a per pin for p121 to p124 notes 1. value of current at which the devic e operation is guaranteed even if the current flow s from an output pin to gnd. 2. specification under conditions wh ere the duty factor is 70% (time for which current is output is 0.7 t and time for which current is not output is 0.3 t, where t is a specific time). the total output current of the pins at a duty factor of other than 70% can be calculated by the following expression. ? where the duty factor of i oh is n%: total output current of pins = (i oh 0.7) / (n 0.01) where the duty factor is 50%, i oh = 20.0 ma total output current of pins = (20.0 0.7) / (50 0.01) = 28.0 ma however, the current that is allowed to flow into one pin does not vary depending on the duty factor. a current higher than the absolute maximum rating must not flow into one pin. remark unless specified otherwise, the characteristics of alter nate-function pins are the sa me as those of port pins.
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 772 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. dc characteristics (3/6) (t a = ? 40 to +125 c, 2.7 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit v ih1 p12, p13, p15, p40 to p47, p50 to p57, p64 to p67, p70, p74, p121 to p124 0.7v dd v dd v v ih2 p00, p01, p05, p06, p10, p11, p14, p16, p17, p30 to p33, p71 to p73, p75, p76, p120, p131, p132, reset, exclk, exclks 0.8v dd v dd v v ih3 p80 to p87, p90 to p97 av ref = v dd 0.7av ref av ref v input voltage, high v ih4 p60 to p63 0.7v dd 6.0 v v il1 p12, p13, p15, p40 to p47, p50 to p57, p60 to p67, p70, p74, p121 to p124 0 0.3v dd v v il2 p00, p01, p05, p06, p10, p11, p14, p16, p17, p30 to p33, p71, p72, p73, p75, p76, p120, p131, p132, reset, exclk, exclks 0 0.2v dd v input voltage, low v il3 p80 to p87, p90 to p93 av ref = v dd 0 0.3av ref v i oh = ? 1.5 ma 4.0 v v dd 5.5 v v dd ? 0.7 v v oh1 i oh = ? 1.0 ma p00, p01, p05, p06, p10 to p17, p30 to p33, p40 to p47, p50 to p57, p64 to p67, p70 to p76, p120, p130 to p132 2.7 v v dd < 4.0 v v dd ? 0.7 v i oh = ? 100 a p80 to p87, p90 to p97 av ref = v dd v dd ? 0.5 v output voltage, high v oh2 p121 to p124 i ol = 4.0ma 4.0 v v dd 5.5 v 0.7 v v ol1 i ol = 2.0 ma p00, p01, p05, p06, p10 to p17, p30 to p33, p40 to p47, p50 to p57, p64 to p67, p70 to p76, p120, p130 to p132 2.7 v v dd < 4.0 v 0.7 v p80 to p87, p90 to p97 av ref = v dd 0.4 v ol2 i ol = 400 a p121 to p124 v i ol = 8 ma p60 to p63 4.0 v v dd 5.5 v 2.0 v i ol = 2.0 ma 0.6 v output voltage, low v ol3 i ol = 2.0 ma 2.7 v v dd < 4.0 v 0.6 v remark unless specified otherwise, the charac teristics of alternate-function pins are the same as those of port pins.
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 773 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. dc characteristics (4/6) (t a = ? 40 to +125 c, 2.7 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit i lih1 v i = v dd p00, p01, p05, p06, p10 to p17, p30 to p33, p40 to p47, p50 to p57, p60 to p67, p70 to p76, p120, p131, p132, reset, flmd0 5 a i lih2 v i = av ref p80 to p87, p90 to p97 av ref = v dd 5 a i lih3 v i = v dd p121 to p124 i/o port mode 5 a input leakage current, high (x1, x2, xt1, xt2) osc port mode 20 a i lil1 v i = v ss p00, p01, p05, p06, p10 to p17, p30 to p33, p40 to p47, p50 to p57, p60 to p67, p70 to p76, p120, p131, p132, reset, flmd0 ? 5 a i lil2 p80 to p87, p90 to p97 av ref = v dd ? 5 a i lil3 p121 to p124 i/o port mode ? 5 a input leakage current, low (x1, x2, xt1, xt2) osc port mode ? 20 a pull-up resistor r u v i = v ss 10 20 100 k flmd0 supply voltage v il in normal operation mode 0 0.2v dd v v ih in self programming mode 0.8 v dd v dd v remark unless specified otherwise, the characteristics of alter nate-function pins are the sa me as those of port pins.
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 774 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. dc characteristics (5/6) (t a = ? 40 to +125 c, 2.7 v v dd = ev dd 5.5 v, 2.7 v av ref v dd , v ss = ev ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit square wave input 3.4 10.3 f xh = 20 mhz note 2 , v dd = 5.0 v resonator connection 4.7 12.5 ma square wave input 1.8 5.4 f xh = 10 mhz notes 2, 3 , v dd = 5.0 v resonator connection 2.5 7.2 ma square wave input 1.7 5.4 f xh = 10 mhz notes 2, 3 , v dd = 3.0 v resonator connection 2.4 6.0 ma square wave input 1.0 3.0 f xh = 5 mhz notes 2, 3 , v dd = 3.0 v resonator connection 1.4 3.6 ma f rh = 8 mhz note 4 , v dd = 5.0 v 1.5 4.2 ma square wave input 6 138 i dd1 operating mode f sub = 32.768 khz note 5 , v dd = 5.0 v resonator connection 15 145 a square wave input 1.0 5.9 f xh = 20 mhz note 2 , v dd = 5.0 v resonator connection 2.2 8.6 ma square wave input 0.6 3.1 f xh = 10 mhz notes 2, 3 , v dd = 5.0 v resonator connection 1.2 4.7 ma square wave input 0.3 1.6 f xh = 5 mhz notes 2, 3 , v dd = 3.0 v resonator connection 0.6 2.4 ma f rh = 8 mhz note 4 , v dd = 5.0 v 0.5 2.1 ma square wave input 3.0 133 i dd2 halt mode f sub = 32.768 khz note 5 , v dd = 5.0 v resonator connection 12 138 a supply current note 1 i dd3 note 6 stop mode v dd = 5.0 v 1 100 a notes 1. total current flowing into the internal power supply (v dd , ev dd ), including the peripheral operation current and the input leakage current flowing when t he level of the input pin are fixed to v dd or v ss . however, the current flowing into the pull-up resistors and t he output current of the port is not included. 2. not including the operating current of the 8 mhz inte rnal oscillator, xt1 oscillation, 240 khz internal oscillator and the current flowing into the a/d converter, watchdog timer and lvi circuit. 3. when amph (bit 0 of clock operation mode select register (oscctl)) = 0. 4. not including the operating current of the x1 oscillation, xt1 oscillation and 240 khz internal oscillator. not including the current flowing into the a/d converte r, watchdog timer, lvi circuit and can controller. 5. not including the operating current of the x1 oscill ation, 8 mhz internal oscillator and 240 khz internal oscillator, and the current flowing into the a/ d converter, watchdog timer and lvi circuit. 6. not including the operating current of the 240 khz internal oscillator and xt1 oscillation, and the current flowing into the a/d converter, watchdog timer and lvi circuit. remarks 1. f xh : high-speed system clock frequency (x1 clock oscill ation frequency or external main system clock frequency) 2. f rh : internal high-speed oscillation clock frequency 3. f sub : subsystem clock frequency (xt1 clock oscillation frequency or external subsystem clock frequency)
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 775 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. dc characteristics (6/6) (t a = ? 40 to +125 c, 2.7 v v dd = ev dd 5.5 v, av ref v dd , v ss = ev ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit a/d converter operating current i adc note 1 adce = 1 2.7 v av ref v dd 0.86 2.9 ma watchdog timer operating current i wdt note 2 during 240 khz internal low-speed oscillation clock operation 5 15 a lvi operating current i lvi note 3 9 27 a notes 1. current flowing only to the a/d converter (av ref -pin). the current value of the 78k0/fx2 microcontrollers is the sum of i dd1 or i dd2 and i adc when the a/d converter operates in an operation mode or the halt mode. 2. current flowing only to the watchdog timer (v dd -pin) (including the operating current of the 240 khz internal oscillator). the current value of the 78k0/fx2 microcontrolle rs is the sum of i dd2 or i dd3 and i wdt when the watchdog timer operates in the halt or stop mode. 3. current flowing only to the lvi circuit (v dd -pin). the current value of the 78k0/fx2 microcontrollers is the sum of i dd2 or i dd3 and i lvi when the lvi circuit operates in the halt or stop mode.
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 776 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. 28.4 ac characteristics (1) basic operation (t a = ? 40 to +125 c, 2.7 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit 4.0 v v dd 5.5 v 0.1 8 s main system clock (f xp ) operation 2.7 v v dd < 4.0 v 0.2 8 s instruction cycle (minimum instruction execution time) t cy subsystem clock (f sub ) operation 114 122 125 s 4.0 v v dd 5.5 v 20 f prs = f xh 2.7 v v dd < 4.0 v note 1 10 mhz peripheral hardware clock frequency f prs f prs = f rh 2.7 v v dd 5.5 v 7.6 8.46 mhz 4.0 v v dd 5.5 v 4.0 20 mhz external main system clock frequency f ext 2.7 v v dd < 4.0 v 4.0 10 mhz 4.0 v v dd 5.5 v 24 external clock input high level width, low level width f exth , f extl 2.7 v v dd < 4.0 v 48 ns external subsystem clock frequency f exts 32 32.768 35 khz external sub clock input high level width, low level width f extsh , f extsl 12 s 4.0 v v dd 5.5 v 2/f sam + 0.1 note 2 s ti000, ti001, ti002, ti003, ti010, ti011 ti012, ti013 input high-level width, low-level width t tih0 , t til0 2.7 v v dd < 4.0 v 2/f sam + 0.2 note 2 s 4.0 v v dd 5.5 v 10 mhz ti50, ti51 input frequency f ti5 2.7 v v dd < 4.0 v 10 mhz 4.0 v v dd 5.5 v 50 ns ti50, ti51 input high-level width, low-level width t tih5 , t til5 2.7 v v dd < 4.0 v 50 ns 1 s interrupt input high-level width, low-level width t inih , t inil reset low-level width t rsl 10 s notes 1. characteristics of the main system clock frequency. set the division clock to be set by a peripheral function to f xh /2 (10 mhz) or less. the multiplie r/divider, however, can operate on f xh (20 mhz). 2. selection of f sam = f prs , f prs /4, f prs /256, or f prs , f prs /16, f prs /64 is possible using bits 0 and 1 (prm0n0, prm0n1) of prescaler mode registers 0n (prm0n). note that when selecting the ti00n valid edge as the count clock, f sam = f prs . (n = 0 to 3)
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 777 (a2) grade products t cy vs. v dd (main system clock operation) supply voltage v dd [v] cycle time t cy [ s] 5.0 1.0 2.0 0.4 0.2 0.1 0 10.0 1.0 2.0 3.0 4.0 5.0 6.0 5.5 20.0 8.0 2.7 guaranteed operation range (the gray portion is applicable only if amph = 1 is set.)
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 778 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. ac timing test points (excluding x1, xt1) v ih v il test points v ih v il external clock input timing exclk 0.8v dd 0.2v dd 1/f ext t extl t exth 1/f exts t extsl t extsh exclks 0.8v dd 0.2v dd ti timing ti000, ti001, ti002, ti003, ti010, ti011, ti012, ti013 t til0 t tih0 ti50, ti51 1/f ti5 t til5 t tih5 interrupt request input timing intp0 to intp7 t intl t inth
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 779 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. reset input timing reset t rsl (2) serial interface (t a = ? 40 to +125 c, 2.7v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) (a) uart mode (uart6n, dedicated baud rate generator output) parameter symbol conditions min. typ. max. unit transfer rate 625 kbps (b) 3-wire serial i/o mode (master mode, sck1n... internal clock output) parameter symbol conditions min. typ. max. unit 4.0 v v dd 5.5 v 200 ns sck1n cycle time t kcy1 2.7 v v dd < 4.0 v 400 ns 4.0 v v dd 5.5 v t kcy1 /2 ? 20 note 1 ns sck1n high-/low-level width t kh1 , t kl1 2.7 v v dd < 4.0 v t kcy1 /2 ? 30 note 1 ns 4.0 v v dd 5.5 v 70 ns si1n setup time (to sck1n ) t sik1 2.7 v v dd < 4.0 v 100 ns si1n hold time (from sck1n ) t ksi1 30 ns delay time from sck1n to so1n output t kso1 c = 50 pf note 2 40 ns notes 1. it is value at the time of f x use. keep in mind that spec different at the time of f osc8 use. 2. c is the load capacitance of the sck1n and so1n output lines. (c) 3-wire serial i/o mode (slave mode, sck1n... external clock input) parameter symbol conditions min. typ. max. unit sck1n cycle time t kcy2 400 ns sck1n high-/low-level width t kh2 , t kl2 t kcy2 /2 ns si1n setup time (to sck1n ) t sik2 80 ns si1n hold time (from sck1n ) t ksi2 50 ns 4.0 v v dd 5.5 v 120 delay time from sck1n to so1n output t kso2 c = 50 pf note 2.7 v v dd < 4.0 v 120 ns note c is the load capacitance of the so1n output line. remark n = 0, 1
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 780 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. serial transfer timing 3-wire serial i/o mode: si1n so1n t kcym t klm t khm t sikm t ksim input data t ksom output data sck1n remark m = 1, 2 n = 0, 1
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 781 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. (3) can controller (t a = ? 40 to +125 c, 2.7 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit transfer rate 1 mbps internal delay time t node 100 ns can internal clock ctxd pin (transfer data) crxd pin (receive data) t output t input note internal delay time (t node ) = internal transfer delay (t output ) + internal receive delay (t input ) note can internal clock (f can ): can baud rate clock image figure of internal delay 78k0/fx2 microcontrollers ctxd pin crxd pin can macro internal receive delay internal transfer delay
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 782 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. (4) a/d converter characteristics (t a = ? 40 to +125 c, 2.7 v v dd = ev dd 5.5 v, v ss = ev ss = av ss = 0 v) parameter symbol conditions min. typ. max. unit resolution res 10 bit 4.0 v v dd 5.5 v 0.4 overall error notes 1, 2 a inl 2.7 v v dd < 4.0 v 0.6 %fsr 4.0 v v dd 5.5 v 6.1 66.6 conversion time t conv 2.7 v v dd < 4.0 v 12.2 66.6 s 4.0 v v dd 5.5 v 0.4 zero-scale error notes 1, 2 e zs 2.7 v v dd < 4.0 v 0.6 %fsr 4.0 v v dd 5.5 v 0.4 full-scale error notes 1, 2 e fs 2.7 v v dd < 4.0 v 0.6 %fsr 4.0 v v dd 5.5 v 2.5 integral non-linearity error note 1 i le 2.7 v v dd < 4.0 v 4.5 lsb 4.0 v v dd 5.5 v 1.5 differential non-linearity error note 1 d le 2.7 v v dd < 4.0 v 2.0 lsb analog input voltage v ain av ss av ref v notes 1. excludes quantization error ( 1/2 lsb). 2. this value is indicated as a ratio (%fsr) to the full-scale value.
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 783 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. (5) poc circuit characteristics (t a = ? 40 to +125 c, v ss = 0 v) parameter symbol conditions min. typ. max. unit detection voltage v poc0 1.44 1.59 1.74 v power supply rise time t pth v dd : 0 v v poc0 0.5 v/ms minimum pulse width t pw 200 s poc circuit timing supply voltage (v dd ) time detection voltage (min.) detection voltage (typ.) detection voltage (max.) t pw t pth
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 784 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. (6) lvi circuit characteristics (t a = ? 40 to +125 c, v poc v dd = ev dd 5.5 v, av ref v dd , v ss = ev ss = 0 v) parameter symbol conditions min. typ. max. unit v lvi0 4.14 4.24 4.34 v v lvi1 3.99 4.09 4.19 v v lvi2 3.83 3.93 4.03 v v lvi3 3.68 3.78 3.88 v v lvi4 3.52 3.62 3.72 v v lvi5 3.37 3.47 3.57 v v lvi6 3.22 3.32 3.42 v v lvi7 3.06 3.16 3.26 v v lvi8 2.91 3.01 3.11 v supply voltage level v lvi9 2.75 2.85 2.95 v external input pin note 1 ex lvi ex lvi < v dd , 2.7 v v dd 5.5 v 1.11 1.21 1.31 v detection voltage detection voltage on application of supply voltage vdd lvi lvistart (option bye) = 1 2.50 2.70 2.90 v minimum pulse width t lw 200 s operation stabilization wait time note 2 t lwait1 10 s notes 1. external input pin is alternate p120/intp pin. 2. time required from setting lvion to 1 to operation stabilization. remark v lvin ? 1 > v lvin (n = 1 to 9) lvi circuit timing supply voltage (v dd ) time detection voltage (min.) detection voltage (typ.) detection voltage (max.) t lwait1 t lw lvion 1
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 785 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. (7) power supply starting time (t a = ? 40 to +125 c, v ss = 0 v) parameter symbol conditions min. typ. max. unit starting maximum time to v dd min (2.7v) note1 (v dd : 0 v 2.7v) t pup1 lvi starting option invalid when pin reset intact 3.6 ms starting maximum time to v dd min (2.7v) note1 (pin reset release v dd : 2.7v) t pup2 lvi starting option invalid when pin reset use 1.9 ms notes 1. start a power supply in time shorter t han this when lvi staring option invalid. 2. it is base on the spec of poc. 2.7 v 0 v poc t pup1 v dd 2.7 v 0 v poc t pup2 v dd reset pin pin reset intact pin reset use
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 786 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. 28.5 data retention characteristics data memory stop mode low supply vo ltage data retention characteristics (t a = ? 40 to +125 c) parameter symbol conditions min. typ. max. unit data retention supply voltage v dddr 1.44 note 5.5 v note the value depends on the poc det ection voltage. when the voltage drop s, the data is retained until a poc reset is effected, but data is not re tained when a poc reset is effected. data retention timing v dddr data retention characteristics v dd stop instruction execution stop mode standby release signal (interrupt request) operation
chapter 28 electrical specifications ((a2) grade products) user?s manual u19180ej1v0ud 787 (a2) grade products caution the pins mounted depend on the product. refer to caution 2 at the beginning of this chapter. 28.6 flash eeprom programming characteristics (1) basic characteristics (t a = ? 40 to +125 c, 2.7 v v dd = ev dd 5.5 v, v ss = ev ss = 0 v) parameter symbol conditions min. typ. max. unit v dd supply current i dd f xp = 10 mhz (typ.), 20 mhz (max.) 4.5 16 ma all block t eraca 20 200 ms erase time notes 1, 2 block unit t erasa 20 200 ms write time (in 8-bit units) note 1 t wrwa 10 100 s when a flash memory programmer is used, and the libraries note 4 provided by nec electronics are used 15 years 1000 times when the eeprom emulation libraries note 5 provided by nec electronics are used, and the rewritable rom size is 4 kb 5 years 10000 times number of rewrites per chip c erwr 1 erase + 1 write after erase = 1 rewrite note 3 conditions other than the above note 6 10 years 100 times notes 1. characteristic of the flash memory. for the char acteristic when a dedicated flash memory programmer, pg-fp4 or pg-fp5, is used and the rewr ite time during self programming, see tables 24-15 to 24-17 . 2. the prewrite time before erasure and the erase verify time (writeback time) are not included. 3. when a product is first written after shipment, ?erase write? and ?write only? are both taken as one rewrite. remark spec may change after device evaluation.
user?s manual u19180ej1v0ud 788 chapter 29 package drawings 29.1 78k0/fc2 ? pd78f0881agba-gaf-g, 78f0881agba2-gaf -g, 78f0882agba-gaf-g, 78f0882agba2-gaf-g, 78f0883agba-gaf-g, 78f0883agba2-gaf-g s y e s x b m l c lp hd he zd ze l1 a1 a2 a d e a3 s 0.125 + 0.075 ? 0.025 (unit:mm) item dimensions d e hd he a a1 a2 a3 10.00 0.20 10.00 0.20 12.00 0.20 12.00 0.20 1.60 max. 0.10 0.05 1.40 0.05 0.25 c e x y zd ze 0.80 0.20 0.10 1.00 1.00 l lp l1 0.50 0.60 0.15 1.00 0.20 p44gb-80-gaf 3 + 5 ? 3 note each lead centerline is located within 0.20 mm of its true position at maximum material condition. detail of lead end 44-pin plastic lqfp (10x10) 0.35 + 0.08 ? 0.04 b 11 22 44 12 23 34 33 1
chapter 29 package drawings user?s manual u19180ej1v0ud 789 ? pd78f0884agaa-gam-g, 78f0884agaa2-gam- g, 78f0885agaa-gam-g, 78f0885agaa2-gam-g, 78f0886agaa-gam-g, 78f0886agaa2-gam- g, 78f0894agaa-gam-g, 78f0894agaa2-gam-g, 78f0895agaa-gam-g, 78f0895agaa2-gam-g 48-pin plastic lqfp (fine pitch) (7x7) s y e s x b m l c lp hd he zd ze l1 a1 a2 a d e a3 s 0.125 + 0.075 ? 0.025 (unit:mm) item dimensions d e hd he a a1 a2 a3 7.00 0.20 7.00 0.20 9.00 0.20 9.00 0.20 1.60 max. 0.10 0.05 1.40 0.05 0.25 c e x y zd ze 0.50 0.08 0.08 0.75 0.75 l lp l1 0.50 0.60 0.15 1.00 0.20 p48ga-50-gam 3 + 5 ? 3 note each lead centerline is located within 0.08 mm of its true position at maximum material condition. detail of lead end 0.20 b 12 24 1 48 13 25 37 36 + 0.07 ? 0.03
chapter 29 package drawings user?s manual u19180ej1v0ud 790 29.2 78k0/fe2 ? pd78f0887agba-gah-g, 78f0887agba2-gah-g, 78f0888agba-gah-g, 78f0888agba2-gah-g, 78f0889agba-gah-g, 78f0889agba2-gah-g, 78f0890agba-gah-g, 78f0890agba2-gah-g s y e s x b m l c lp hd he zd ze l1 a1 a2 a d e a3 s 0.125 + 0.075 ? 0.025 (unit:mm) item dimensions d e hd he a a1 a2 a3 10.00 0.20 10.00 0.20 12.00 0.20 12.00 0.20 1.60 max. 0.10 0.05 1.40 0.05 0.25 c e x y zd ze 0.50 0.08 0.08 1.25 1.25 l lp l1 0.50 0.60 0.15 1.00 0.20 p64gb-50-gah 3 + 5 ? 3 note each lead centerline is located within 0.08 mm of its true position at maximum material condition. detail of lead end 0.20 b 16 32 1 64 17 33 49 48 64-pin plastic lqfp(fine pitch)(10x10) + 0.07 ? 0.03
chapter 29 package drawings user?s manual u19180ej1v0ud 791 ? pd78f0887agka-gaj-g, 78f0887agka2-gaj-g, 78f0888agka-gaj-g, 78f0888agka2-gaj-g, 78f0889agka-gaj-g, 78f0889agka2-gaj-g, 78f0890agka-gaj-g, 78f0890agka2-gaj-g l c lp hd he zd ze l1 a1 a2 a d e 0.125 + 0.75 ? 0.25 (unit:mm) item dimensions d e hd he a a1 a2 a3 12.00 0.20 12.00 0.20 14.00 0.20 14.00 0.20 1.60 max. 0.10 0.05 1.40 0.05 0.25 c e x y zd ze 0.65 0.13 0.10 1.125 1.125 l lp l1 0.50 0.60 0.15 1.00 0.20 p64gk-65-gaj 3 + 5 ? 3 note each lead centerline is located within 0.13 mm of its true position at maximum material condition. detail of lead end 64-pin plastic lqfp (12x12) 0.30 + 0.08 ? 0.04 b 16 32 1 64 17 33 49 48 s y e s x b m a3 s
chapter 29 package drawings user?s manual u19180ej1v0ud 792 29.3 78k0/ff2 ? pd78f0891agca-gad-g, 78f0891agca 2-gad-g, 78f0892agca-gad-g, 78f0892agca2-gad-g, 78f0893agca- gad-g, 78f0893agca2-gad-g s y e s x b m l c lp hd he zd ze l1 a1 a2 a d e a3 s 0.125 + 0.075 ? 0.025 (unit:mm) item dimensions d e hd he a a1 a2 a3 14.00 0.20 14.00 0.20 17.20 0.20 17.20 0.20 1.70 max. 0.125 0.075 1.40 0.05 0.25 c e x y zd ze 0.65 0.13 0.10 0.825 0.825 l lp l1 0.80 0.886 0.15 1.60 0.20 p80gc-65-gad 3 + 5 ? 3 note each lead centerline is located within 0.13 mm of its true position at maximum material condition. detail of lead end 80-pin plastic lqfp (14x14) 0.30 b 20 40 80 21 41 60 1 + 0.08 ? 0.04 61
chapter 29 package drawings user?s manual u19180ej1v0ud 793 ? pd78f0891agka-gak-g, 78f0891agka 2-gak-g, 78f0892agka-gak-g, 78f0892agka2-gak-g, 78f0893agka- gak-g, 78f0893agka2-gak-g s y e s x b m l c lp hd he zd ze l1 a1 a2 a d e a3 s 0.125 + 0.075 ? 0.025 (unit:mm) item dimensions d e hd he a a1 a2 a3 12.00 0.20 12.00 0.20 14.00 0.20 14.00 0.20 1.60 max. 0.10 0.05 1.40 0.05 0.25 c e x y zd ze 0.50 0.08 0.08 1.25 1.25 l lp l1 0.50 0.60 0.15 1.00 0.20 p80gk-50-gak 3 + 5 ? 3 note each lead centerline is located within 0.08 mm of its true position at maximum material condition. detail of lead end 0.20 b 20 40 1 80 21 41 61 60 80-pin plastic lqfp (fine pitch) (12x12) + 0.07 ? 0.03
user?s manual u19180ej1v0ud 794 chapter 30 recommended soldering conditions these products should be soldered and mounted under the following recommended conditions. for soldering methods and conditions other than those recommended below, please contact an nec electronics sales representative. for technical information, see the following website. semiconductor device mount manual (http ://www.necel.com/pkg/en/mount/index.html) table 30-1. surface mounting ty pe soldering conditions ? 44-pin plastic lqfp (10 10) pd78f0881agba-gaf-g, 78f0881agba2-gaf -g, 78f0882agba-gaf-g, 78f0882agba2-gaf-g, 78f0883agba-gaf-g, 78f0883agba2-gaf-g ? 48-pin plastic lqfp (7 7) pd78f0884agaa-gam-g, 78f0884agaa2-gam- g, 78f0885agaa-gam-g, 78f0885agaa2-gam-g, 78f0886agaa-gam-g, 78f0886agaa2-gam-g, 78f0894agaa-gam-g, 78f0894agaa2-gam-g, 78f0895agaa-gam-g, 78f0895agaa2-gam-g ? 64-pin plastic lqfp (10 10) pd78f0887agba-gah-g, 78f0887agba2-gah- g, 78f0888agba-gah-g, 78f0888agba2-gah-g, 78f0889agba-gah-g, 78f0889agba2-gah-g, 78f 0890agba-gah-g, 78f0890agba2-gah-g ? 64-pin plastic lqfp (12 12) pd78f0887agka-gaj-g, 78f0887agka2-gaj -g, 78f0888agka-gaj-g, 78f0888agka2-gaj-g, 78f0889agka-gaj-g, 78f0889agka2-gaj-g, 78f 0890agka-gaj-g, 78f0890agka2-gaj-g ? 80-pin plastic lqfp (14 14) pd78f0891agca-gad-g, 78f0891agca2-gad-g, 78f0892agca-gad-g, 78f0892agca2-gad-g, 78f0893agca-gad-g, 78f0893agca2-gad-g ? 80-pin plastic lqfp (12 12) pd78f0891agka-gak-g, 78f0891agka2-g ak-g, 78f0892agka-gak-g, 78f0892agka2-gak-g, 78f0893agka-gak-g, 78f0893agka2-gak-g soldering method soldering conditions recommended condition symbol infrared reflow package peak temperature: 260 c, time: 60 seconds max. (at 220 c or higher), count: 3 times or less, exposure limit: 7 days note (after that, prebake at 125 c for 20 to 72 hours) ir60-207-3 partial heating pin temperature: 350 c max., time: 3 seconds max. (per pin row) ? note after opening the dry pack, store it at 25 c or less and 65% rh or less for the allowable storage period. caution do not use different soldering methods together ( except for partial heating).
user?s manual u19180ej1v0ud 795 chapter 31 cautions for wait 31.1 cautions for wait this product has two internal system buses. one is a cpu bus and the other is a peripheral bus that interfaces with the low-speed peripheral hardware. because the clock of the cpu bus and the clock of the peripheral bus are asynchronous, unexpected illegal data may be passed if an access to the cpu conflicts with an access to the peripheral hardware. when accessing the peripheral hardware that may cause a conflict, therefore, the cpu repeatedly executes processing, until the correct data is passed. as a result, the cpu does not start the next instruction processing but waits. if this happens, the number of execution clocks of an instruction incr eases by the number of wait clocks (f or the number of wait clocks, see table 31- 1 ). this must be noted when r eal-time processing is performed.
chapter 31 cautions for wait user?s manual u19180ej1v0ud 796 31.2 peripheral hardware that generates wait table 31-1 lists the register s that issue a wait request when accessed by the cpu, and the number of cpu wait clocks. table 31-1. registers that generate wait and number of cpu wait clocks peripheral hardware register access number of wait clocks serial interface uart60 asis60 read 1 clock (fixed) serial interface uart61 asis61 read 1 clock (fixed) adm write ads write adpc write adcr read 1 to 5 clocks (when f ad = f prs /2 is selected) 1 to 7 clocks (when f ad = f prs /3 is selected) 1 to 9 clocks (when f ad = f prs /4 is selected) 2 to 13 clocks (when f ad = f prs /6 is selected) 2 to 17 clocks (when f ad = f prs /8 is selected) 2 to 25 clocks (when f ad = f prs /12 is selected) a/d converter the above number of clocks is when the same source clock is selected for f cpu and f prs . the number of wait clocks can be calculated by the followi ng expression and under the following conditions. ? number of wait clocks = 2 f cpu f ad + 1 * fraction is truncated if the number of wait clocks 0.5 and rounded up if the number of wait clocks > 0.5. f ad : a/d conversion clock frequency (f prs /2 to f prs /12) f cpu : cpu clock frequency f prs : peripheral hardware clock frequency f xp : main system clock frequency ? maximum number of times: maximum speed of cpu (f xp ), lowest speed of a/d conversion clock (f prs /12) ? minimum number of times: minimum speed of cpu (f sub /2), highest speed of a/d conversion clock (f prs /2) caution when the cpu is operating on the subsystem clock and the peri pheral hardware clock is stopped, do not access the registers listed ab ove using an access method in which a wait request is issued. remark the clock is the cpu clock (f cpu ).
chapter 31 cautions for wait user?s manual u19180ej1v0ud 797 table 31-2 ram access that generate wait and number of cpu wait clocks number of wait clocks peripheral hardware register access min. max. cause global reg. canmodule reg. read/write 1 1 synchronizaition of npb signals with vpclk min. roundup[(1/f vpclk ) 1/(1/f vpstb )] max. roundup[(1/f vpclk ) 2/(1/f vpstb )] c0rgpt c0lipt c0tgpt c0lopt message buf. read 2 14 synchronization of npb signals with vpclk ram access delay (1 ram ? rd access) min. roundup[(1/f canclk ) 3/(1/f vpstb )] max. roundup[(1/f canclk ) 4/(1/f vpstb )] message buf. write(8 bit) 2 17 synchronization of npb signals with vpclk ram access delay (1ram ? rd + 1ram ? wr access) min. roundup[(1/f canclk ) 4/(1/f vpstb )] max. roundup[(1/f canclk ) 5/(1/f vpstb )] can message buf. write(16 bit) 1 11 synchronization of npb signals with vpclk ram access delay (1 ram ? wr access) min. roundup[(1/f canclk ) 2/(1/f vpstb )] max. roundup[(1/f canclk ) 3/(1/f vpstb )] caution when value is canmod (can module system clock) 2 mhz. remark f vpclk : vpclk frequency f vpstb : vpstb frequency f canclk : afcan macro frequency
chapter 31 cautions for wait user?s manual u19180ej1v0ud 798 31.3 example of wait occurrence ? serial interface uart61 number of execution clocks: 6 (5 clocks when data is read from a register that does not issue a wait (mov a, sfr).)
user?s manual u19180ej1v0ud 799 appendix a development tools the following development tools are available for th e development of systems that employ the 78k0/fx2 microcontrollers. figure a-1 shows the developm ent tool configuration.
appendix a development tools user?s manual u19180ej1v0ud 800 figure a-1. development tool configuration (1/3) (1) when using the in-circuit emulator qb-78k0fx2 language processing software assembler package c compiler package device file note 1 debugging software integrated debugger note 1 system simulator note 2 host machine (pc or ews) qb-78k0fx2 note 4 emulation probe target system software package project manager software package control software (windows only) note 3 power supply unit usb interface cable note 4 78k0/fx2 microcontroller flash memory programmer note 4 flash memory write adapter < flash memory write environment > conversion adapter on-board programming off-board programming target connector notes 1. download the device file for 78k0/fx2 microc ontrollers (df780893) and the integrated debugger id78k0-qb from the download site for development tools (http://www.necel.com/micro/en/ods/index.html). 2. sm+ for 78k0 (instruction simulation version) is included in the software package. sm+ for 78k0/fx2 (instruction + peripheral simulation version) is not included. 3. the project manager pm+ is included in the assembler package. pm+ cannot be used other than with windows tm . 4. qb-78k0fx2 is supplied with t he integrated debugger id78k0-qb, a usb interface cable, the on-chip debug emulator with programming f unction qb-mini2, connection cables (10-pin and 16-pin cables), and the 78k0-ocd board. any other products are sold separately.
appendix a development tools user?s manual u19180ej1v0ud 801 figure a-1. development tool configuration (2/3) (2) when using the on-chip debug emulator qb-78k0mini language processing software ? assembler package ? c compiler package ? device file note 1 ? c library source file note 2 debugging software ? integrated debugger note 4 ? system simulator host machine (pc or ews) usb interface cable note 4 qb-78k0mini note 4 connection cable note 4 target connector target system flash memory programmer flash memory write adapter flash memory ? software package ? project manager software package flash memory write environment control software (windows only) note 3 notes 1. download the device file for 78k0/fx2 microcont rollers (df780893) from the download site for development tools (http://www.necel .com/micro/en/ods/index.html). 2. the c library source file is not included in the software package. 3. the project manager pm+ is included in the assembler package. pm+ is only used for windows. 4. on-chip debug emulator qb-78k0mini is suppl ied with integrated debugger id78k0-qb, usb interface cable, and connection cable. any other products are sold separately.
appendix a development tools user?s manual u19180ej1v0ud 802 figure a-1. development tool configuration (3/3) (2) when using the on-chip debug emulator with programming function qb-mini2 language processing software ? assembler package ? c compiler package ? device file note 1 debugging software ? integrated debugger note 1 ? system simulator note 2 host machine (pc or ews) usb interface cable note 4 qb-mini2 note 4 78k0-ocd board note 4 target connector target system ? software package ? project manager software package control software (windows only) note 3 connection cable (10-pin/16-pin cable) note 4 qb-mini2 note 4 connection cable (16-pin cable) note 4 notes 1. download the device file for 78k0/fx2 microc ontrollers (df780893) and the integrated debugger id78k0-qb from the download site for development tools (http://www.necel.com/micro/en/ods/index.html). 2. sm+ for 78k0 (instruction simulation version) is included in the software package. sm+ for 78k0/fx2 (instruction + peripheral simulation version) is not included. 3. the project manager pm+ is included in the assembler package. pm+ cannot be used other than with windows. 4. qb-mini2 is supplied with usb interface cable, c onnection cables (10-pin cable and 16-pin cable), and 78k0-ocd board. any other products are sold se parately. in addition, download the software for operating the qb-mini2 from the download site for development tools (http://www.necel.com/micro/en/ods/index.html).
appendix a development tools user?s manual u19180ej1v0ud 803 a.1 software package sp78k0 78k0 microcontroller software package development tools (software) common to the 78k0 microcontrollers are combined in this package. a.2 language processing software ra78k0 note 1 assembler package this assembler converts programs written in mnemonics into object codes executable with a microcontroller. this assembler is also provided with functi ons capable of automatically creating symbol tables and branch instruction optimization. this assembler should be used in comb ination with a device file (df780893). this assembler package is a dos-based applic ation. it can also be used in windows, however, by using the project manager (pm+) on windows. pm+ is included in assembler package. cc78k0 note 1 c compiler package this compiler converts programs written in c language into object codes executable with a microcontroller. this compiler should be used in combination with an assembler package and device file. this c compiler package is a dos-based applic ation. it can also be used in windows, however, by using the project manager (pm+) on windows. pm+ is included in assembler package. df780893 note 2 device file this file contains informat ion peculiar to the device. this device file should be used in combinati on with a tool (ra78k0, cc78k0, id78k0- qb, and the system simulator). the corresponding os and host machine di ffer depending on the tool to be used. notes 1. if the versions of ra78k0 and cc78k0 are ver.4.00 or later, different versions of ra78k0 and cc78k0 can be installed on the same machine. 2. the df780893 can be used in common with t he ra78k0, cc78k0, id78k0-qb, and the system simulator. download the df780893 from the download site for development tools (http://www.necel.com/micro/en/ods/index.html).
appendix a development tools user?s manual u19180ej1v0ud 804 a.3 flash memory programming tools a.3.1 when using flash memory programmer pg-fp5, fl-pr5, fg-fp4, and fl-pr4 pg-fp5, fl-pr5, pg-fp4 note 1 , fl-pr4 flash memory programmer flash memory programmer dedicated to micr ocontrollers with on-chip flash memory. fa-xxxx note 2 flash memory programming adapter flash memory programming adapter used connec ted to the flash memory programmer for use. notes 1. phase-out 2. the part numbers of the flash memory programming adapter and the packages of the target device are described below. package flash memory programming adapter 48-pin plastic lqfp (ga-gam type) fa-44gb-gaf-b, fa-78f0883gb-gaf-rx, fa-78f0883gb-ues-mx 78k0/fc2 44-pin plastic lqfp (gb-gaf type) fa-48ga-gam-b, fa-78f0886ga-gam-rx 64-pin plastic lqfp (gb-gah type) fa-64gb-gah-b, fa-78f0890gb-gah-rx, fa-78f0890gb-ueu-mx 78k0/fe2 64-pin plastic lqfp (gk-gaj type) fa-64gk-gaj-b, fa-78f0890gk-gaj-rx, fa-78f0890gk-uet-mx 80-pin plastic lqfp (gc-gad type) fa-80gc-gad-b, fa-78f0893gc-gad-rx, fa-78f0893gc-ubt-mx 78k0/ff2 80-pin plastic lqfp (gk-gak type) fa-80gk-gak-b, fa-78f0893gk-gak-rx remarks 1. fl-pr5, fl-pr4, and fa-xxxx are products of naito densei machida mfg. co., ltd (http://www.ndk-m.co.jp/, tel: +81-42-750-4172). 2. use the latest version of the flash memory programming adapter. a.3.2 when using on-chip debug emulator with programming function qb-mini2 qb-mini2 on-chip debug emulator with programming function this is a flash memory programmer dedicat ed to microcontrollers with on-chip flash memory. it is available also as on-chip debug emulator which serves to debug hardware and software when developing application syst ems using the 78k0/fx2 microcontrollers. when using this as flash memo ry programmer, it should be used in combination with a connection cable (16-pin cable) and a usb interface cabl e that is used to connect the host machine. target connector specific ations 16-pin general-purpose connector (2.54 mm pitch) remarks 1. the qb-mini2 is supplied with a usb interface cable and connection cables (10-pin cable and 16-pin cable), and the 78k0-ocd board. a connection cable (10-pin cable) and the 78k0-ocd board are used only when using the on-chip debug function. 2. download the software for operating the qb-mini 2 from the download site for development tools (http://www.necel.com/micro/en/ods/index.html).
appendix a development tools user?s manual u19180ej1v0ud 805 a.4 debugging tools (hardware) a.4.1 when using in-circuit emulator qb-78k0fx2 qb-78k0fx2 in-circuit emulator the in-circuit emulator serves to debug har dware and software when developing application systems using the 78k0/fx2 microcontrollers. it supports the integrated debugger (id78k0- qb). this emulator should be used in comb ination with a power supply unit and emulation probe, and the usb is used to connect th is emulator to the host machine. qb-144-ca-01 check pin adapter this adapter is used in waveform m onitoring using the oscilloscope, etc. qb-80-ep-01t emulation probe this emulation probe is flexible type and used to connect the in-circuit emulator and target system. qb-xxxx-ea-xxx note exchange adapter this adapter is used to perform the pin conversion from the in-circuit emulator to the target connector. qb-xxxx-ys-xxx note space adapter this space adapter is used to adjust the height between the target system and in-circuit emulator. qb-xxxx-yq-xxx note yq connector this yq connector is used to connect the target connector and exchange adapter. qb-xxxx-hq-xxx note mount adapter this mount adapter is used to mount the target device with socket. qb-xxxx-nq-xxx note target connector this target connector is used to mount on the target system. note the part numbers of the exchange adapter, space a dapter, yq connector, mount adapter, and target connector and the packages of the ta rget device are described below. package exchange adapter space adapter yq connector mount adapter target connector 44-pin plastic lqfp (gb-gaf type) qb-44gb- ea-02t qb-44gb- ys-01t qb-44gb- yq-01t qb-44gb- hq-01t qb-44gb- nq-01t 78k0/fc2 48-pin plastic lqfp (ga-gam type) qb-48ga- ea-01t qb-48ga- ys-01t qb-48ga- yq-01t qb-48ga- hq-01t qb-48ga- nq-01t 64-pin plastic lqfp (gb-gah type) qb-64gb- ea-03t qb-64gb- ys-01t qb-64gb- yq-01t qb-64gb- hq-01t qb-64gb- nq-01t 78k0/fe2 64-pin plastic lqfp (gk-gaj type) qb-64gk- ea-03t qb-64gk- ys-01t qb-64gk- yq-01t qb-64gk- hq-01t qb-64gk- nq-01t 80-pin plastic lqfp (gc-gad type) qb-80gc- ea-01t qb-80gc- ys-01t qb-80gc- yq-01t qb-80gc- hq-01t qb-80gc- nq-01t 78k0/ff2 80-pin plastic lqfp (gk-gak type) qb-80gk- ea-01t qb-80gk- ys-01t qb-80gk- yq-01t qb-80gk- hq-01t qb-80gk- nq-01t
appendix a development tools user?s manual u19180ej1v0ud 806 remarks 1. the qb-78k0fx2 is supplied with the integrat ed debugger id78k0-qb, a usb interface cable, a power supply unit, the on-chip debug emulator qb -mini2, connection cables (10-pin and 16-pin cables), and the 78k0-ocd board. download the software for operating the qb-mini 2 from the download site for development tools (http://www.necel.com/micro/en/ods/inde x.html) when using the qb-mini2. 2. the packed contents differ depending on the part number, as follows. package contents part number in-circuit emulator emulation probe ex change adapter yq connector target connector qb-78k0fx2-zzz (-ee) not included qb-78k0fx2-t44gb qb-44gb-ea-02t qb-44gb-yq-01t qb-44gb-nq-01t qb-78k0fx2-t48ga qb-48ga-ea-01t qb-48ga-yq-01t qb-48ga-nq-01t qb-78k0fx2-t64gb qb-64gb-ea-03t qb-64gb-yq-01t qb-64gb-nq-01t qb-78k0fx2-t64gk qb-64gk-ea-03t qb-64gk-yq-01t qb-64gk-nq-01t qb-78k0fx2-t80gc qb-80gc-ea-01t qb-80gc-yq-01t qb-80gc-nq-01t qb-78k0fx2-t80gk qb-78k0fx2 qb-80-ep-01t qb-80gk-ea-01t qb-80gk-yq-01t qb-80gk-nq-01t a.4.2 when using on-chip debug emulator qb-78k0mini qb-78k0mini notes 1, 2 on-chip debug emulator this on-chip debug emulator serves to debug hardware and software when developing application systems using the 78k0/fx2. it supports the integrated debugger (id78k0- qb). this emulator should be used in combination with connection cable and a usb interface cable that is used to connect the host machine. target connector specific ations 10-pin general-purpose connector (2.54 mm pitch) remark the qb-78k0mini is supplied with a usb interface c able and a connection cable. as control software, the integrated debugger id78k0-qb is supplied. a.4.3 when using on-chip debug emulator with programming function qb-mini2 qb-mini2 on-chip debug emulator with programming function this on-chip debug emulator serves to debug hardware and software when developing application systems using the 78k0/fx2. it is available also as flash memory programmer dedicated to microcontrollers with on-chip flash memory. when using this as on-chip debug emulator, it should be used in combination with a connection cable (10- pin cable or 16-pin cable), a usb interfac e cable that is used to connect the host machine, and the 78k0-ocd board. target connector specifications 10-pin general-purpose connector (2.54 mm pi tch) or 16-pin general-purpose connector (2.54 mm pitch) remarks 1. the qb-mini2 is supplied with a usb interface ca ble and connection cables (10-pin cable and 16-pin cable), and the 78k0-ocd board. a connection cable (10-pin c able) and the 78k0-ocd board are used only when using the on-chip debug function. 2. download the software for operating the qb-mini 2 from the download site for development tools (http://www.necel.com/micro/en/ods/index.html).
appendix a development tools user?s manual u19180ej1v0ud 807 a.5 debugging tools (software) id78k0-qb note integrated debugger this debugger supports the in-circuit emulat ors for the 78k0 microcontrollers. the id78k0-qb is windows-based software. it has improved c-compatible debugging functions and can display the results of tracing with the source program using an integrating window function that associates the source program, disassemble display, and memory display with the trace result. it should be used in combination with the device file (df780893). sm+ for 78k0 sm+ for 78k0/fx2 system simulator system simulator is windows-based software. it is used to perform debugging at the c source level or assembler level while simulating the operation of the target system on a host machine. use of system simulator allows the exec ution of application logical testing and performance testing on an independent basis from hardware development, thereby providing higher development e fficiency and software quality. system simulator should be used in combi nation with the device file (df780893). the following two types of system simulato rs supporting the 78k0/fx2 microcontrollers are available. ? sm+ for 78k0 (instructi on simulation version) this can only simulate a cpu. it is included in the software package. ? sm+ for 78k0/fx2 (instruction + peripheral simulation version) this can simulate a cpu and peripheral hardw are (ports, timers, serial interfaces, etc.). it is sold separately from the software package. note download the id78k0-qb from the download site for development tools (http://www.necel.com/micro/en/ods/index.html).
user?s manual u19180ej1v0ud 808 appendix b notes on target system design this chapter shows areas on the tar get system where component mounting is prohibited and areas where there are component mounting height restrictions when the qb-78k0fx2 is used. (a) case of 44-pin gb package figure b-1. the restriction domain on a target system (case of 44-pin gb package) 15 9.85 13.375 10 15 9.85 17.375 10 : exchange adapter area: com ponents up to 17.45 mm in height can be mounted note : emulation probe tip area: co mponents up to 24.45 mm in height can be mounted note note height can be adjusted by using space adapters (each adds 2.4 mm)
appendix b notes on target system design user?s manual u19180ej1v0ud 809 (b) case of 48-pin ga package figure b-2. the restriction domain on a target system (case of 48-pin ga package) 15 9.5 13.375 10 15 9.5 17.375 10 : exchange adapter area: com ponents up to 17.45 mm in height can be mounted note : emulation probe tip area: co mponents up to 24.45 mm in height can be mounted note note height can be adjusted by using space adapters (each adds 2.4 mm)
appendix b notes on target system design user?s manual u19180ej1v0ud 810 (c) case of 64-pin gb package figure b-3. the restriction domain on a target system (case of 64-pin gb package) 15 10.5 13.375 10 15 10.5 17.375 10 : exchange adapter area: com ponents up to 17.45 mm in height can be mounted note : emulation probe tip area: co mponents up to 24.45 mm in height can be mounted note note height can be adjusted by using space adapters (each adds 2.4 mm)
appendix b notes on target system design user?s manual u19180ej1v0ud 811 (d) case of 64-pin gk package figure b-4. the restriction domain on a target system (case of 64-pin gk package) 15 10.5 13.375 10 15 10.5 17.375 10 : exchange adapter area: com ponents up to 17.45 mm in height can be mounted note : emulation probe tip area: co mponents up to 24.45 mm in height can be mounted note note height can be adjusted by using space adapters (each adds 2.4 mm)
appendix b notes on target system design user?s manual u19180ej1v0ud 812 (e) case of 80-pin gc package figure b-5. the restriction domain on a target system (case of 80-pin gc package) 15 12.05 13.375 10 15 12.05 17.375 10 : exchange adapter area: com ponents up to 17.45 mm in height can be mounted note : emulation probe tip area: co mponents up to 24.45 mm in height can be mounted note note height can be adjusted by using space adapters (each adds 2.4 mm)
appendix b notes on target system design user?s manual u19180ej1v0ud 813 (f) case of 80-pin gk package figure b-6. the restriction domain on a target system (case of 80-pin gk package) 15 10.5 13.375 10 15 10.5 17.375 10 : exchange adapter area: com ponents up to 17.45 mm in height can be mounted note : emulation probe tip area: co mponents up to 24.45 mm in height can be mounted note note height can be adjusted by using space adapters (each adds 2.4 mm)
user?s manual u19180ej1v0ud 814 appendix c register index c.1 register index (in alphabetical or der with respect to register names) [1] 10-bit a/d conversion resu lt register (adcr)................................................................................... ...........................359 16-bit timer capture/compar e register 000 (c r000) .............................................................................. ......................226 16-bit timer capture/compar e register 001 (c r001) .............................................................................. ......................226 16-bit timer capture/compar e register 002 (c r002) .............................................................................. ......................226 16-bit timer capture/compar e register 003 (c r003) .............................................................................. ......................226 16-bit timer capture/compar e register 010 (c r010) .............................................................................. ......................228 16-bit timer capture/compar e register 011 (c r011) .............................................................................. ......................228 16-bit timer capture/compar e register 012 (c r012) .............................................................................. ......................228 16-bit timer capture/compar e register 013 (c r013) .............................................................................. ......................228 16-bit timer count er 00 (t m00)................................................................................................. ...................................225 16-bit timer count er 01 (t m01)................................................................................................. ...................................225 16-bit timer count er 02 (t m02)................................................................................................. ...................................225 16-bit timer count er 03 (t m03)................................................................................................. ...................................225 16-bit timer mode contro l register 00 (tmc 00).................................................................................. ..........................233 16-bit timer mode contro l register 01 (tmc 01).................................................................................. ..........................233 16-bit timer mode contro l register 02 (tmc 02).................................................................................. ..........................233 16-bit timer mode contro l register 03 (tmc 03).................................................................................. ..........................233 16-bit timer output cont rol register 00 (t oc00)................................................................................ ...........................241 16-bit timer output cont rol register 01 (t oc01)................................................................................ ...........................241 16-bit timer output cont rol register 02 (t oc02)................................................................................ ...........................241 16-bit timer output cont rol register 03 (t oc03)................................................................................ ...........................241 [8] 8-bit a/d conversion resu lt register (adcrh) ................................................................................... ..........................360 8-bit timer compare re gister 50 (cr50) ......................................................................................... ..............................291 8-bit timer compare re gister 51 (cr51) ......................................................................................... ..............................291 8-bit timer coun ter 50 (t m50).................................................................................................. ....................................290 8-bit timer coun ter 51 (t m51).................................................................................................. ....................................290 8-bit timer h carrier cont rol register 1 (tmc yc1).............................................................................. ..........................315 8-bit timer h compare register 00 (cmp00)...................................................................................... ...........................310 8-bit timer h compare register 01 (cmp01)...................................................................................... ...........................310 8-bit timer h compare register 10 (cmp10)...................................................................................... ...........................310 8-bit timer h compare register 11 (cmp11)...................................................................................... ...........................310 8-bit timer h mode re gister 0 (tmhmd0) ......................................................................................... ...........................311 8-bit timer h mode re gister 1 (tmhmd1) ......................................................................................... ...........................311 8-bit timer mode contro l register 50 (tmc 50)................................................................................... ...........................295 8-bit timer mode contro l register 51 (tmc 51)................................................................................... ...........................295 [a] a/d converter mode register (adm) .............................................................................................. ..............................356
appendix c register index user?s manual u19180ej1v0ud 815 a/d port configuratio n register (adpc) ......................................................................................... ..............................362 analog input channel specification re gister (ads) .............................................................................. ........................361 asynchronous serial interface control register 60 (asi cl60) .................................................................... ..................402 asynchronous serial interface control register 61 (asi cl61) .................................................................... ..................402 asynchronous serial interface operat ion mode register 60 (asim60) .............................................................. ...........388 asynchronous serial interface operat ion mode register 61 (asim61) .............................................................. ...........388 asynchronous serial interface recepti on error status regi ster 60 ( asis60)...................................................... ...........393 asynchronous serial interface recepti on error status regi ster 61 ( asis61)...................................................... ...........393 asynchronous serial interface transmissi on status regist er 60 ( asif60) ......................................................... ...........395 asynchronous serial interface transmissi on status regist er 61 ( asif61) ......................................................... ...........395 [b] bank select r egister (bank) .................................................................................................... .................................118 baud rate generator contro l register 60 (brg c60)............................................................................... ......................400 baud rate generator contro l register 61 (brg c61)............................................................................... ......................400 [c] can global automatic block transmi ssion control regist er (c0gmabt)............................................................. .........499 can global automatic block transmissi on delay setting regi ster (c0g mabtd)...................................................... ....501 can global clock select ion register (c0gmcs) ................................................................................... .......................498 can global control r egister (c 0gmctrl) ......................................................................................... .........................496 can message configuratio n register (c0mconfm) .................................................................................. ................526 can message control re gister m (c 0mctrlm) ...................................................................................... ...................528 can message data byte regi ster xm (c 0mdataxm) .................................................................................. ...............523 can message data byte regi ster zm (c 0mdatazm) .................................................................................. ...............523 can message data length r egister m (c 0mdlcm) ................................................................................... .................525 can message id regist er hm (c 0midhm) ........................................................................................... ......................527 can message id regist er lm (c 0midlm)........................................................................................... ........................527 can module bit rate pre scaler register (c0brp) ................................................................................ .......................514 can module bit rate register (c0btr)........................................................................................... .............................515 can module control register (c0ctrl)........................................................................................... ...........................504 can module error counter register (c0erc)...................................................................................... ........................510 can module information register (c0info) ....................................................................................... ........................509 can module interrupt ena ble register (c0ie) .................................................................................... .........................511 can module interrupt stat us register (c0i nts) .................................................................................. ........................513 can module last error code register (c0le c) .................................................................................... ........................508 can module last in-point er register (c0lipt)................................................................................... ..........................517 can module last out-point er register (c0lopt).................................................................................. .......................519 can module mask control re gister 1h (c0ma sk1h) ................................................................................. ................502 can module mask control register 1l (c0ma sk1l) ................................................................................. .................502 can module mask control re gister 2h (c0ma sk2h) ................................................................................. ................502 can module mask control re gister 2h (c0ma sk2l)................................................................................. .................502 can module mask control re gister 3h (c0ma sk3h) ................................................................................. ................502 can module mask control register 3l (c0ma sk3l) ................................................................................. .................502 can module mask control re gister 4h (c0ma sk4h) ................................................................................. ................502 can module mask control register 4l (c0ma sk4l) ................................................................................. .................502
appendix c register index user?s manual u19180ej1v0ud 816 can module receive history list register (c0rgpt).............................................................................. ......................518 can module time stam p register (c0ts) .......................................................................................... ..........................521 can module transmit history list register (c0tgpt)............................................................................. ......................520 capture/compare contro l register 00 (crc0 0).................................................................................... ........................237 capture/compare contro l register 01 (crc0 1).................................................................................... ........................237 capture/compare contro l register 02 (crc0 2).................................................................................... ........................237 capture/compare contro l register 03 (crc0 3).................................................................................... ........................237 clock operation mode select register (oscctl) .................................................................................. ......................190 clock output selectio n register (cks) .......................................................................................... ...............................349 clock selection regi ster 60 (cksr60)........................................................................................... ..............................397 clock selection regi ster 61 (cksr61)........................................................................................... ..............................397 [e] external interrupt falling edg e enable regist er (egn).......................................................................... ........................608 external interrupt rising e dge enable regist er (egp)........................................................................... ........................608 [f] flash-programming mode co ntrol register (flpmc) ................................................................................ ...................715 flash protect command register (pfcmd)......................................................................................... .........................717 flash status re gister (pfs).................................................................................................... ......................................717 [i] input switch contro l register (isc) ............................................................................................ ...................................406 internal expansion ram size switching regi ster (ixs)........................................................................... ......................680 internal memory size s witching regist er (ims).................................................................................. ...........................679 internal oscillator mode register (rcm)........................................................................................ ...............................186 interrupt mask flag re gister 0h (mk0h)......................................................................................... ..............................604 interrupt mask flag re gister 0l (mk0l)......................................................................................... ...............................604 interrupt mask flag re gister 1h (mk1h)......................................................................................... ..............................604 interrupt mask flag re gister 1l (mk1l)......................................................................................... ...............................604 interrupt request flag register 0h (if0h) ...................................................................................... ...............................601 interrupt request flag register 0l (if 0l)...................................................................................... .................................601 interrupt request flag register 1h (if1h) ...................................................................................... ...............................601 interrupt request flag register 1l (if 1l)...................................................................................... .................................601 [l] low-voltage detection level selection regi ster (l vis).......................................................................... ........................659 low-voltage detecti on register (lvim).......................................................................................... ...............................658 [m] main clock mode register (mcm) ................................................................................................. ...............................188 main osc control register (moc) ................................................................................................ ...............................189 multiplication/division dat a register a0h (md a0h).............................................................................. ........................643 multiplication/division dat a register a0l (md a0l) .............................................................................. .........................643 multiplication/division dat a register b0 (mdb0) ................................................................................ ...........................644 multiplier/divider contro l register 0 (dm uc0).................................................................................. .............................645
appendix c register index user?s manual u19180ej1v0ud 817 [o] oscillation stabilization time c ounter status r egister (ostc) .................................................................. ....................192 oscillation stabilization time select regi ster (osts).......................................................................... ..........................193 [p] port mode regist er 0 (p m0)..................................................................................................... ....................................167 port mode regist er 1 (p m1)..................................................................................................... ....................................167 port mode regist er 12 (p m12)................................................................................................... ..................................167 port mode regist er 13 (p m13)................................................................................................... ..................................167 port mode regist er 3 (p m3)..................................................................................................... ....................................167 port mode regist er 4 (p m4)..................................................................................................... ....................................167 port mode regist er 5 (p m5)..................................................................................................... ....................................167 port mode regist er 6 (p m6)..................................................................................................... ....................................167 port mode regist er 7 (p m7)..................................................................................................... ....................................167 port mode regist er 8 (p m8)..................................................................................................... ....................................167 port mode regist er 9 (p m9)..................................................................................................... ....................................167 port regist er 0 (p0)........................................................................................................... ...........................................170 port regist er 1 (p1)........................................................................................................... ...........................................170 port register 12 (p12) ......................................................................................................... .........................................170 port register 13 (p13) ......................................................................................................... .........................................170 port regist er 3 (p3)........................................................................................................... ...........................................170 port regist er 4 (p4)........................................................................................................... ...........................................170 port regist er 5 (p5)........................................................................................................... ...........................................170 port regist er 6 (p6)........................................................................................................... ...........................................170 port regist er 7 (p7)........................................................................................................... ...........................................170 port regist er 8 (p8)........................................................................................................... ...........................................170 port regist er 9 (p9)........................................................................................................... ...........................................170 prescaler mode regi ster 00 (prm00)............................................................................................. .............................246 prescaler mode regi ster 01 (prm01)............................................................................................. .............................246 prescaler mode regi ster 02 (prm02)............................................................................................. .............................246 prescaler mode regi ster 03 (prm03)............................................................................................. .............................246 priority specification fl ag register 0h (p r0h) ................................................................................. .............................606 priority specification fl ag register 0l (p r0l) ................................................................................. ..............................606 priority specification fl ag register 1h (p r1h) ................................................................................. .............................606 priority specification fl ag register 1l (p r1l) ................................................................................. ..............................606 processor clock cont rol regist er (pcc) ......................................................................................... ..............................185 program stetaus word ( psw) ..................................................................................................... ................................609 pull-up resistor opti on register 0 (pu0) ....................................................................................... ................................173 pull-up resistor opti on register 1 (pu1) ....................................................................................... ................................173 pull-up resistor opti on register 12 (pu 12) ..................................................................................... ..............................173 pull-up resistor opti on register 13 (pu 13) ..................................................................................... ..............................173 pull-up resistor opti on register 3 (pu3) ....................................................................................... ................................173 pull-up resistor opti on register 4 (pu4) ....................................................................................... ................................173 pull-up resistor opti on register 5 (pu5) ....................................................................................... ................................173 pull-up resistor opti on register 6 (pu6) ....................................................................................... ................................173
appendix c register index user?s manual u19180ej1v0ud 818 pull-up resistor opti on register 7 (pu7) ....................................................................................... ................................173 [r] receive buffer regi ster 60 (rxb60) ............................................................................................. ...............................387 receive buffer regi ster 61 (rxb61) ............................................................................................. ...............................387 receive shift regi ster 60 (rxs60) .............................................................................................. .................................387 receive shift regi ster 61 (rxs61) .............................................................................................. .................................387 remainder data regi ster 0 (sdr0)............................................................................................... ...............................643 reset control flag register (resf) ............................................................................................. .................................640 [s] serial clock selection register 10 (csic10) .................................................................................... .............................435 serial clock selection register 11 (csic11) .................................................................................... .............................435 serial operation mode register 10 (csim 10) ..................................................................................... ..........................433 serial operation mode register 11 (csim 11) ..................................................................................... ..........................433 serial i/o shift regi ster 10 (sio10) ........................................................................................... ...................................432 serial i/o shift regi ster 11 (sio11) ........................................................................................... ...................................432 [t] timer clock selection register 50 (tcl50)...................................................................................... .............................293 timer clock selection register 51 (tcl51)...................................................................................... .............................293 transmit buffer regi ster 10 (s otb10) ........................................................................................... ..............................432 transmit buffer regi ster 11 (s otb11) ........................................................................................... ..............................432 transmit buffer regi ster 60 (txb60)............................................................................................ ................................387 transmit buffer regi ster 61 (txb61)............................................................................................ ................................387 transmit shift regi ster 60 (txs60) ............................................................................................. .................................387 transmit shift regi ster 61 (txs61) ............................................................................................. .................................387 [w] watchdog timer enable register (wdte) .......................................................................................... ..........................342 watch timer operation mode register (wtm) ...................................................................................... ........................335
appendix c register index user?s manual u19180ej1v0ud 819 c.2 register index (in al phabetical order with respect to register symbol) [a] adcr: 10-bit a/d conv ersion result regi ster .................................................................................. .................359 adcrh: 8-bit a/d conv ersion result register.................................................................................. ...................360 adm: a/d conver ter mode re gister ............................................................................................. ..................356 adpc: a/d port conf igureation register ....................................................................................... ...................362 ads: analog in put channel specif ication re gister............................................................................. ............361 asicl60: asynchronous serial interface contro l regist er 60 ................................................................... ............402 asicl61: asynchronous serial interface contro l regist er 61 ................................................................... ............402 asif60: asynchronous serial interf ace transmission stat us regist er 60 ........................................................ ...395 asif61: asynchronous serial interf ace transmission stat us regist er 61 ........................................................ ...395 asim60: asynchronous serial inte rface operation mode register 60 ............................................................. ....388 asim61: asynchronous serial inte rface operation mode register 61 ............................................................. ....388 asis60: asynchronous serial interfac e reception error st atus regi ster 60 ..................................................... ...393 asis61: asynchronous serial interfac e reception error st atus regi ster 61 ..................................................... ...393 [b] bank: bank se lect r egister ................................................................................................... .........................118 brgc60: baud rate genera tor control r egister 60 .............................................................................. ................400 brgc61: baud rate genera tor control r egister 61 .............................................................................. ................400 [c] c0brp: can module bit rate prescale r register ................................................................................ ...............514 c0btr: can module bit rate regist er.......................................................................................... .....................515 c0ctrl: can module control register.......................................................................................... .....................504 c0erc: can module error counter register ..................................................................................... ................510 c0gmabt: can global automatic block transmission co ntrol r egist er ............................................................ ......499 c0gmabtd: can global automatic bl ock transmission dela y setting re gister...................................................... ...501 c0gmcs: can global cl ock selectio n regi ster .................................................................................. ..................498 c0gmctrl: can global control regist er ......................................................................................... ........................496 c0ie: can module in terrupt enabl e regi ster................................................................................... ..............511 c0info: can module information register...................................................................................... ..................509 c0ints: can module in terrupt status regi ster ................................................................................. .................513 c0lec: can module la st error c ode regi ster................................................................................... ................508 c0lipt: can module la st in-pointer register .................................................................................. ..................517 c0lopt: can module la st out-pointer register ................................................................................. .................519 c0mconfm: can message c onfiguration regist er ................................................................................... ...............526 c0mctrlm: can message control regi ster m ...................................................................................... ..................528 c0mdataxm: can message data byte re gister xm ................................................................................... ...............523 c0mdatazm: can message data byte re gister zm ................................................................................... ...............523 c0mdlcm: can message data length r egister m .................................................................................. ...............525 c0mask1h: can module ma sk control re gister 1h................................................................................. ...............502 c0mask1l: can module mask c ontrol regi ster 1l .......................................................................................... ......502 c0mask2h: can module ma sk control re gister 2h................................................................................. ...............502 c0mask2l: can module mask c ontrol regi ster 2h.......................................................................................... ......502
appendix c register index user?s manual u19180ej1v0ud 820 c0mask3h: can module ma sk control re gister 3h.................................................................................. .................502 c0mask3l: can module mask c ontrol regi ster 3l ........................................................................................... ........502 c0mask4h: can module ma sk control re gister 4h.................................................................................. .................502 c0mask4l: can module mask c ontrol regi ster 4l ........................................................................................... ........502 c0midhm: can message id regi ster hm ........................................................................................... .....................527 c0midlm: can message id regi ster lm ........................................................................................... ......................527 c0rgpt: can module receiv e history list regi ster .............................................................................. ..................518 c0tgpt: can module transmi t history list regi ster ............................................................................. ..................520 c0ts: can module ti me stamp register .......................................................................................... .................521 cks: clock output se lection re gister.......................................................................................... .....................349 cksr60: clock select ion regist er 60........................................................................................... ..........................397 cksr61: clock select ion regist er 61........................................................................................... ..........................397 cmp00: 8-bit timer h compare regi ster 00 ...................................................................................... ....................310 cmp01: 8-bit timer h compare regi ster 01 ...................................................................................... ....................310 cmp10: 8-bit timer h compare regi ster 10 ...................................................................................... ....................310 cmp11: 8-bit timer h compare regi ster 11 ...................................................................................... ....................310 cr000: 16-bit timer captur e/compare regi ster 000 .............................................................................. ...............225 cr001: 16-bit timer captur e/compare regi ster 001 .............................................................................. ...............225 cr002: 16-bit timer captur e/compare regi ster 002 .............................................................................. ...............225 cr003: 16-bit timer captur e/compare regi ster 003 .............................................................................. ...............225 cr010: 16-bit timer captur e/compare regi ster 010 .............................................................................. ...............228 cr011: 16-bit timer captur e/compare regi ster 011 .............................................................................. ...............228 cr012: 16-bit timer captur e/compare regi ster 012 .............................................................................. ...............228 cr013: 16-bit timer captur e/compare regi ster 013 .............................................................................. ...............228 cr50: 8-bit timer co mpare regi ster 50 ......................................................................................... .....................291 cr51: 8-bit timer co mpare regi ster 51 ......................................................................................... .....................291 crc00: capture/compare control regi ster 00 .................................................................................... .................237 crc01: capture/compare control regi ster 01 .................................................................................... .................237 crc02: capture/compare control regi ster 02 .................................................................................... .................237 crc03: capture/compare control regi ster 03 .................................................................................... .................237 csic10: serial clock selection re gister 10 .................................................................................... .......................435 csic11: serial clock selection re gister 11 .................................................................................... .......................435 csim10: serial operat ion mode regi ster 10..................................................................................... .....................433 csim11: serial operat ion mode regi ster 11..................................................................................... .....................433 [d] dmuc0: multiplier/divider control re gister 0 .................................................................................. .......................645 [e] egn: external interrupt falling edge enabl e regi ster .......................................................................... .............608 egp: external interrupt rising edge enabl e regi ster ........................................................................... .............608 [f] flpmc: flash-programmi ng mode contro l regi ster ................................................................................ .............715 [i] if0h: interrupt req uest flag regi ster 0h ...................................................................................... .....................601
appendix c register index user?s manual u19180ej1v0ud 821 if0l: interrupt req uest flag regi ster 0l ...................................................................................... .....................601 if1h: interrupt req uest flag regi ster 1h ...................................................................................... .....................601 if1l: interrupt req uest flag regi ster 1l ...................................................................................... .....................601 ims: internal memory size switchin g regi ster.................................................................................. ...............679 isc: input switch control regist er............................................................................................ .......................406 ixs: internal expansion ra m size switch ing regi ster ........................................................................... .........680 [l] lvim: low-voltage de tection re gister ........................................................................................... .....................658 lvis: low-voltage detection level selecti on regi ster ........................................................................... ..............659 [m] mcm: main clo ck mode re gister .................................................................................................. ......................188 mda0h: multiplication/div ision data regi ster a0h............................................................................... ...................643 mda0l: multiplication/div ision data regi ster a0l ............................................................................... ...................643 mdb0: multiplication/div ision data r egister b0 ................................................................................. ...................644 mk0h: interrupt mask flag regist er 0h .......................................................................................... ......................604 mk0l: interrupt mask flag regist er 0l.......................................................................................... .......................604 mk1h: interrupt mask flag regist er 1h .......................................................................................... ......................604 mk1l: interrupt mask flag regist er 1l.......................................................................................... .......................604 moc: main osc c ontrol r egister ................................................................................................. ......................189 [o] oscctl: clock operation mode select regist er ................................................................................... ...................190 ostc: oscillation stabilization ti me counter stat us regi ster ................................................................... .............192 osts: oscillation stabilizati on time select register ........................................................................... ..................193 [p] p0: port r egister 0............................................................................................................ ..............................170 p1: port r egister 1............................................................................................................ ..............................170 p12: port r egister 12.......................................................................................................... ..............................170 p13: port r egister 13.......................................................................................................... ..............................170 p3: port r egister 3............................................................................................................ ..............................170 p4: port r egister 4............................................................................................................ ..............................170 p5: port r egister 5............................................................................................................ ..............................170 p6: port r egister 6............................................................................................................ ..............................170 p7: port r egister 7............................................................................................................ ..............................170 p8: port r egister 8............................................................................................................ ..............................170 p9: port r egister 9............................................................................................................ ..............................170 pcc: processor cloc k control register .......................................................................................... ....................185 pfcmd: flash protec t command r egist er.......................................................................................... ....................717 pfs: flash stat us regi ster ..................................................................................................... ...........................717 pm0: port mode register 0...................................................................................................... ..........................167 pm1: port mode register 1...................................................................................................... ..........................167 pm12: port mode register 12.................................................................................................... ..........................167 pm13: port mode register 13.................................................................................................... ..........................167 pm3: port mode register 3...................................................................................................... ..........................167
appendix c register index user?s manual u19180ej1v0ud 822 pm4: port mode register 4 ...................................................................................................... ..........................167 pm5: port mode register 5 ...................................................................................................... ..........................167 pm6: port mode register 6 ...................................................................................................... ..........................167 pm7: port mode register 7 ...................................................................................................... ..........................167 pm8: port mode register 8 ...................................................................................................... ..........................167 pm9: port mode register 9 ...................................................................................................... ..........................167 pr0h: priority specificat ion flag r egister 0h .................................................................................. .....................606 pr0l: priority specificat ion flag r egister 0l .................................................................................. ......................606 pr1h: priority specificat ion flag r egister 1h .................................................................................. .....................606 pr1l: priority specificat ion flag r egister 1l .................................................................................. ......................606 prm00: prescaler m ode register 00 .............................................................................................. .......................246 prm01: prescaler m ode register 01 .............................................................................................. .......................246 prm02: prescaler m ode register 02 .............................................................................................. .......................246 prm03: prescaler m ode register 03 .............................................................................................. .......................246 psw: program st etaus word ...................................................................................................... .......................609 pu0: pull-up resistor option regi ster 0 ........................................................................................ ......................173 pu1: pull-up resistor option regi ster 1 ........................................................................................ ......................173 pu12: pull-up resistor option regi ster 12 ...................................................................................... ......................173 pu13: pull-up resistor option regi ster 13 ...................................................................................... ......................173 pu3: pull-up resistor option regi ster 3 ........................................................................................ ......................173 pu4: pull-up resistor option regi ster 4 ........................................................................................ ......................173 pu5: pull-up resistor option regi ster 5 ........................................................................................ ......................173 pu6: pull-up resistor option regi ster 6 ........................................................................................ ......................173 pu7: pull-up resistor option regi ster 7 ........................................................................................ ......................173 [r] rcm: internal oscill ator mode register ......................................................................................... .....................187 resf: reset contro l flag re gister.............................................................................................. ..........................640 rxb60: receive bu ffer regist er 60 .............................................................................................. .........................387 rxb61: receive bu ffer regist er 61 .............................................................................................. .........................387 rxs60: receive sh ift register 60 ............................................................................................... ...........................387 rxs61: receive sh ift register 61 ............................................................................................... ...........................387 [s] sdr0: remainder dat a regist er 0 ............................................................................................... .......................643 sio10: serial i/o sh ift register 10 ............................................................................................ ............................432 sio11: serial i/o sh ift register 11 ............................................................................................ ............................432 sotb10: transmit bu ffer regist er 10 ............................................................................................ ..........................432 sotb11: transmit bu ffer regist er 11 ............................................................................................ ..........................432 [t] tcl50: timer clock sele ction regi ster 50 ....................................................................................... ......................293 tcl51: timer clock sele ction regi ster 51 ....................................................................................... ......................293 tm00: 16-bit time r counter 00.................................................................................................. ...........................225 tm01: 16-bit time r counter 01.................................................................................................. ...........................225 tm02: 16-bit time r counter 02.................................................................................................. ...........................225 tm03: 16-bit time r counter 03.................................................................................................. ...........................225
appendix c register index user?s manual u19180ej1v0ud 823 tm50: 8-bit time r counte r 50 ................................................................................................... ...........................290 tm51: 8-bit time r counte r 51 ................................................................................................... ...........................290 tmc00: 16-bit timer mode control regi ster 00................................................................................... ....................232 tmc01: 16-bit timer mode control regi ster 01................................................................................... ....................232 tmc02: 16-bit timer mode control regi ster 02................................................................................... ....................232 tmc03: 16-bit timer mode control regi ster 03................................................................................... ....................232 tmc50: 8-bit timer mode control re gister 50.................................................................................... .....................295 tmc51: 8-bit timer mode control re gister 51.................................................................................... .....................295 tmcyc1: 8-bit timer h carri er control r egister 1 ............................................................................... .......................315 tmhmd0: 8-bit timer h mode regi ster 0.......................................................................................... .........................311 tmhmd1: 8-bit timer h mode regi ster 1.......................................................................................... .........................311 toc00: 16-bit timer output control re gister 00................................................................................. .....................241 toc01: 16-bit timer output control re gister 01................................................................................. .....................241 toc02: 16-bit timer output control re gister 02................................................................................. .....................241 toc03: 16-bit timer output control re gister 03................................................................................. .....................241 txb60: transmit bu ffer regist er 60 ............................................................................................. .........................387 txb61: transmit bu ffer regist er 61 ............................................................................................. .........................387 txs60: transmit sh ift register 60.............................................................................................. ...........................387 txs61: transmit sh ift register 61.............................................................................................. ...........................387 [w] wdte: watchdog timer enable re gister ........................................................................................... ...................342 wtm: watch timer oper ation mode regist er ....................................................................................... ...............335
user?s manual u19180ej1v0ud 824 appendix d list of cautions this appendix lists cautions described in this document. ?classification (hard/soft)? in table is as follows. hard: cautions for microcontroller internal/external hardware soft: cautions for software such as register settings or programs (1/32) chapter classification function details of function cautions page on-chip debug function the 78k0/fx2 microcontrollers have an on-chip debug function, which is provided for development and evaluation. do not use the on-chip debug function in products designated for mass produc tion, because the guaranteed number of rewritable times of the flash memory may be exceeded when this function is used, and product reliability therefore cannot be guaranteed. nec electronics is not liable for problems occurring when the on-chip debug function is used. p. 31 av ss make av ss the same potential as v ss /ev ss . pp. 34, 35 av ss make av ss the same potential as v ss . pp. 36, 37 ev dd make ev dd the same potential as v dd . pp. 36, 37 regc connect the regc pin to v ss via a capacitor (0.47 to 1 f: recommended). pp. 34 to 37 chapter 1 hard pin function ani0/p80 to anin/p8n, ani8/p90 to anin/p9n ani0/p80 to anin/p8n, ani8/p90 to anin/p9n are set in the analog input mode after release of reset. pp. 34 to 37 be sure to pull the p31/ti002/intp2 pin down before a reset release, to prevent malfunction. p. 60 p31/ti002/ intp2 connect p31/ti002/intp2 as follows when wr iting the flash memory with a flash memory programmer. - p31/ti002/intp2: connect to ev ss via a resistor (10 k : recommended). the above connection is not nec essary when writing the flash memory by means of self programming. p. 60 p80/ani0 to p87/ani7 p80/ani0 to p87/ani7 are set in the analog input mode after release of reset. p. 63 ani8/p90 to ani15/p97 p90/ani8 to p97/ani15 are set in the analog input mode after release of reset. p. 64 p121/x1 connect p121/x1 as follows when writ ing the flash memory with a flash memory programmer. - p121/x1: when using this pi n as a port, connect it to v ss via a resistor (10 k : recommended) (in the input mode) or leave it open (in the output mode). the above connection is not nec essary when writing the flash memory by means of self programming. p. 65 chapter 2 hard pin function regc pin keep the wiring length as short as possible for the broken-line part in the above figure. p. 67 regardless of the internal memory capacit y, the initial values of the internal memory size switching register (ims) and internal expansion ram size switching register (ixs) of all products in the 78k 0/fx2 microcontrollers are fixed (ims = cfh, ixs = 0ch). therefore, set t he value corresponding to each product as indicated below. p. 72 chapter 3 soft memory space ims, ixs: internal memory size switching register, internal expansion ram size switching register to set the memory size, set ims and then ixs. set the memory size so that the internal rom and internal expansi on ram areas do not overlap. p. 72
appendix d list of cautions user?s manual u19180ej1v0ud 825 (2/32) chapter classification function details of function cautions page instructions cannot be fetched between different memory banks. p. 82 branch and access cannot be directly executed between different memory banks. execute branch or access between different memory banks via the common area. p. 82 allocate interrupt servicing in the common area. p. 82 memory bank an instruction that extends from 7fffh to 8000h can only be executed in memory bank 0. p. 82 sfr: special function register do not access addresses to which sfrs are not assigned. p. 84 chapter 3 soft memory space sp: stack pointer since reset signal generation makes t he sp contents undefined, be sure to initialize the sp before using the stack. p. 92 bank: memory bank select register be sure to change the value of the bank register in the common area (0000h to 7fffh). if the value of the bank register is changed in the bank area (8000h to bfffh), an inadvertent program loop occurs in the cpu. therefore, never change the value of the bank register in the bank area. p. 118 instructions cannot be fetched between different memory banks. p. 119 branching and accessing cannot be directly executed between different memory banks. execute branching or accessing between different memory banks via the common area. p. 119 allocate interrupt servicing in the common area. p. 119 chapter 4 soft memory bank switching function (products whose flash memory is at least 96 kb only) memory bank an instruction that extends from 7fffh to 8000h can only be executed in memory bank 0. p. 119 p05/ssi11/ti001 to use p05/ssi11/ti001 as general -purpose ports, set serial operation mode register 11 (csim11) to the default status (00h). p. 131 p10/sck10/ txd61, p12/so10 to use p10/sck10/txd61 and p12/so10 as general-purpose ports, set serial operation mode register 10 (csim10) and serial clock sele ction register 10 (csic10) to the default status (00h) p. 134 soft p10/sck10/ txd61, p13/txd60 to use p10/sck10/txd61 and p13/txd60 as general-purpose por ts, clear bit 0 (txdlv60, txdlv61) of asynchronous seri al interface control register 60, 61 (asicl60, asicl61) to 0 (normal output of txd6n). p. 134 be sure to pull the p31 pin down before a reset release, to prevent malfunction. p. 140 hard p31/ti002/ intp2 connect p31/ti002/intp2 as follows when wr iting the flash memory with a flash programmer. - p31/ti002/intp2: connect to ev ss via a resistor (10 k : recommended). the above connection is not nec essary when writing the flash memory by means of self programming. p. 140 soft p74/so11, p76/sck11 to use p74/so11 and p76/sck11 as general -purpose ports, set serial operation mode register 10 (csim10) and serial clock selection resister 10 (csic10) to the default status (00h). p. 150 port 8 make the av ref pin the same potential as the v dd pin when port 8 is used as a digital port. p. 155 chapter 5 hard port function port 9 make the av ref pin the same potential as the v dd pin when port 9 is used as a digital port. p. 157
appendix d list of cautions user?s manual u19180ej1v0ud 826 (3/32) chapter classification function details of function cautions page soft when using the p121 to p124 pins to connect a resonator for the main system clock (x1, x2) or subsystem clock (xt1, xt2), or to input an external clock for the main system clock (exclk) or subsyst em clock (exclks), the x1 oscillation mode, xt1 oscillation mode, or external clock input mode must be set by using the clock operation mode select register (o scctl) (for details, see 6.3 (1) clock operation mode select register (oscctl) and (3) setting of operation mode for subsystem clock pin). the reset value of oscctl is 00h (all of the p121 to p124 pins are i/o port pins). at th is time, setting of the pm121 to pm124 and p121 to p124 pins is not necessary. p. 159 hard p121/x1, p122/x2/exclk, p123/xt1, p124/xt2/exclks connect p121/x1 as follows when writi ng the flash memory with a flash programmer. - p121/x1: when using this pi n as a port, connect it to v ss via a resistor (10 k : recommended) (in the input mode) or leave it open (in the output mode). the above connection is not nec essary when writing the flash memory by means of self programming. p. 159 set the channel used for a/d conversion to the input mode by using port mode register 8 (pm8) and port mode register 9 (pm9). p. 177 do not set the pin set by adpc as digital i/o by analog input channel specification register (ads). p. 177 adpc: a/d port configuration register if data is written to adpc, a wait cycle is generated. do not write data to adpc when the cpu is operating on the subsystem clock and the peripheral hardware clock is stopped. for details, s ee chapter 31 cautions for wait. p. 177 chapter 5 soft port function 1-bit manipulation instruction for port register n (pn) when a 1-bit manipulation instruction is executed on a port that provides both input and output functions, the output latc h value of an input port that is not subject to manipulation may be wri tten in addition to the targeted bit. therefore, it is recommended to rewrite the output latch when switching a port from input mode to output mode. p. 181 pcc: processor clock control register be sure to clear bits 3, 6 and 7 to ?0?. p. 186 rcm: internal oscillation mode register when setting rstop to 1, be sure to conf irm that the cpu operates with a clock other than the internal high-speed oscillation clock. specifically, set rstop to 1 under either of the following conditions. ? when mcs = 1 (when cpu operates with the high-speed system clock) ? when cls = 1 (when cpu operates with the subsystem clock) p. 187 xsel can be changed only once after a reset release. p. 188 soft the peripheral hardware cannot operate w hen the peripheral hardware clock is stopped. to resume the operation of the peripheral hardware after the peripheral hardware clock has been stopped, init ialize the peripheral hardware. p. 188 a clock other than f prs is supplied to the following peripheral functions regardless of the setting of xsel and mcm0. ? watchdog timer ? when ?f rl /2 7 ? is selected as the count clock for 8-bit timer h1 ? peripheral hardware selects the exte rnal clock as the clock source (except when the external count clock of tm0n (n = 0, 1) is selected (ti00n pin valid edge)) p. 188 chapter 6 hard clock generator mcm: main clock mode register it takes one clock to change the cpu clock. p. 188
appendix d list of cautions user?s manual u19180ej1v0ud 827 (4/32) chapter classification function details of function cautions page when setting mstop to 1, be sure to conf irm that the cpu operates with a clock other than the high-speed system clock. specifically, set mstop to 1 under either of the following conditions. ? when mcs = 0 (when cpu operates with the internal high-speed oscillation clock) ? when cls = 1 (when cpu operates with the subsystem clock) in addition, stop peripheral hardware that is operating on the high-speed system clock before setting mstop to 1. p. 189 do not clear mstop to 0 while bit 6 (oscsel) of the clock operation mode select register (oscctl) is 0. p. 189 moc: main osc control register the peripheral hardware cannot operate w hen the peripheral hardware clock is stopped. to resume the operation of the peripheral hardware after the peripheral hardware clock has been stopped, init ialize the peripheral hardware. p. 189 be sure to set amph to 1 if the high-speed system clock oscillation frequency exceeds 10 mhz. p. 190 set amph before setting the main clock mode register (mcm). p. 190 set amph before setting the peripheral functi ons after a reset release. the value of amph can be changed only once after a reset release. when the high-speed system clock (x1 oscillation) is selected as the cpu clock, supply of the cpu clock is stopped for 4.06 to 16.12 s after amph is set to 1. when the high- speed system clock (external clock input) is selected as the cpu clock, supply of the cpu clock is stopped for the duration of 160 external clocks after amph is set to 1. p. 190 if the stop instruction is executed when amph = 1, supply of the cpu clock is stopped for 4.06 to 16.12 s after the stop mode is released when the internal high-speed oscillation clock is selected as the cpu clock, or for the duration of 160 external clocks when the high-speed system clock (external clock input) is selected as the cpu clock. when the hi gh-speed system clock (x1 oscillation) is selected as the cpu clock, the oscillation stabilization time is counted after the stop mode is released. p. 190 amph can be changed only once after a reset release. p. 190 to change the value of exclk and oscsel, be sure to confirm that bit 7 (mstop) of the main osc control register (moc) is 1 (the x1 oscillator stops or the external clock from t he exclk pin is disabled). p. 191 oscctl: clock operation mode select register to change the value of exclks and oscsels, confirm that bit 5 (cls) of the processor clock control register (pcc) is 0 (the cpu is operating with the highspeed system clock). p. 191 after the above time has elapsed, the bits are set to 1 in order from most11 and remain 1. p. 192 soft if the stop mode is entered and then re leased while the internal high-speed oscillation clock or subsystem clock is being used as the cpu clock, set the oscillation stabilization time as follows. ? desired ostc oscillation stabilization time oscillation stabilization time set by osts the oscillation stabilization time counter counts up to the oscillation stabilization time set by osts. note, therefore, that only the status up to the oscillation stabilization time set by osts is set to ostc after stop mode is released. p. 192 chapter 6 hard clock generator ostc: oscillation stabilization time counter status register the x1 clock oscillation stabilization wait time does not include the time until clock oscillation starts (?a? below). p. 192
appendix d list of cautions user?s manual u19180ej1v0ud 828 (5/32) cha p te r classification function details of function cautions page to set the stop mode when the x1 clock is used as the cpu clock, set osts before executing the stop instruction. p. 193 do not change the value of the osts register during the x1 clock oscillation stabilization time. p. 193 soft the oscillation stabilization time counter counts up to the oscillation stabilization time set by osts. if the stop mode is entered and then released while the internal high-speed oscillation clock is being used as the cpu clock, set the oscillation stabilization time as follows. ? desired ostc oscillation stabilization time oscillation stabilization time set by osts the oscillation stabilization time counter counts up to the oscillation stabilization time set by osts. note, therefore, that only the status up to the oscillation stabilization time set by osts is set to ostc after stop mode is released. p. 193 clock generator osts: oscillation stabilization time select register the x1 clock oscillation stabilization wait time does not include the time until clock oscillation starts (?a? below). p. 193 when using the x1 oscillator and xt1 oscillator, wire as follows in the area enclosed by the broken lines in the figures 6-12 and 6-13 to avoid an adverse effect from wiring capacitance. ? keep the wiring length as short as possible. ? do not cross the wiring with the other signal lines. do not route the wiring near a signal line through which a high fluctuating current flows. ? always make the ground point of the oscillator capacitor the same potential as v ss . do not ground the capacitor to a ground pattern through which a high current flows. ? do not fetch signals from the oscillator. note that the xt1 oscillator is designed as a low-amplitude circuit for reducing power consumption. p. 195 x1/xt1 oscillator ? when x2 and xt1 are wired in parallel, the crosstalk noise of x2 may increase with xt1, resulting in malfunctioning. p. 196 when the standup of voltage until it reaches 1. 8 v from the time of a power supply injection is looser than 0.5 v/ms (min.), input a low level into reset pin, or set up 2.7 v/1.59 v poc mode (lvistart = 1) from an option byte until it reaches 1.8 v from the time of a power supply injection (refer to figure 6-13). when a low level is inputted into reset pin until it reaches 1.8 v, after the reset release by reset pin operates to the same timing as <2> of figure 6-12 or subsequent ones. p. 201 when using the external clock input fr om exclk pin and exclks pin, oscillation stable waiting time is unnecessary. p. 201 a voltage oscillation stabilization time of 1.93 to 5.39 ms is required after the power supply voltage reaches 1.59 v (typ.). if the supply voltage rises from 1.59 v (typ.) to 2.7 v (typ.) within 1.93 ms, the power supply oscillation stabilization time of 0 to 5.39 ms is automatically generated before reset processing. p. 202 chapter 6 hard clock generator operation when power supply voltage is turned on ? it is not necessary to wait for the oscillation stabilization time when an external clock input from the exclk and exclks pins is used. p. 202
appendix d list of cautions user?s manual u19180ej1v0ud 829 (6/32) cha p te r classification function details of function cautions page x1/p121 and x2/exclk/p122 the x1/p121 and x2/exclk/p122 pins are in the i/o port mode after a reset release. p. 203 do not change the value of exclk and oscsel while the x1 clock is operating. p. 204 x1 clock set the x1 clock after the supply voltage has reached the operable voltage of the clock to be used (see chapter 27 electrical specifications ((a) grade products) or chapter 28 el ectrical specifications ((a2) grade products)). p. 204 do not change the value of exclk and oscsel while the external main systerm clock is operating. p. 204 external main system clock set the external main system clock after the supply voltage has reached the operable voltage of the clock to be used (see chapter 27 electrical specifications ((a) grade product s) or chapter 28 electrical specifications ((a2) grade products)). p. 204 main system clock if the high-speed system clock is selected as the main system clock, a clock other than the high-speed system clock cannot be set as the peripheral hardware clock. p. 205 controlling high-speed system clock high-speed system clock be sure to confirm that mcs = 0 or cls = 1 when setting mstop to 1. in addition, stop peripheral hardware that is operating on the high-speed system clock. p. 206 controlling internal high-speed oscillation clock internal high- speed oscillation clock be sure to confirm that mcs = 1 or cls = 1 when setting rstop to 1. in addition, stop peripheral hardware that is operati ng on the internal high-speed oscillation clock. p. 208 xt1/p123, xt2/exclks/ p124 the xt1/p123 and xt2/exclks/p124 pins are in the i/o port mode after a reset release. p. 208 xt1 clock, external subsystem clock do not change the value of xtstart, exclks, and oscsels while the subsystem clock is operating. pp. 208, 209 be sure to confirm that cls = 0 when clearing oscsels to 0. in addition, stop the watch timer if it is operating on the subsystem clock. p. 209 controlling subsystem clock subsystem clock the subsystem clock oscillation cannot be stopped using the stop instruction. p. 209 controlling internal low- speed oscillation clock internal low- speed oscillation clock if ?internal low-speed oscillator cannot be stopped? is selected by the option byte, oscillation of the internal low-speed oscillation clock cannot be controlled. p. 210 selection of the main system clock cycl e division factor (pcc0 to pcc2) and switchover from the main system clock to the subsystem clock (changing css from 0 to 1) should not be set simultaneously. simultaneous setting is possible, however, for selection of the main system clock cycle division factor (pcc0 to pcc2) and sw itchover from the subsystem clock to the main system clock (changing css from 1 to 0). p. 217 chapter 6 soft cpu clock ? when switching the internal high-speed o scillation clock to the high-speed system clock, bit 2 (xsel) of mcm must be set to 1 in advance. the value of xsel can be changed only once after a reset release. p. 218
appendix d list of cautions user?s manual u19180ej1v0ud 830 (7/32) cha p te r classification function details of function cautions page be careful to the following restricti ons for function of 16-bit timer/event counter 01 for pd78f0881a, 78f0882a, and 78f0883a. ? selecting ti001 and ti011 for count clock is prohibited. when using ti001 for baud rate error calculation, it is not applicable. ? timer output is prohibited. for details, see 7.6 (12) 16-bit ti mer/event counter 01 of 78k0/fc2. p. 219 be careful to the following restricti ons for function of 16-bit timer/event counter 01 for pd78f0884a, 78f0885a, 78f0886a, 78f0894a, and 78f0895a. ? selecting ti001 for count clock is prohibited. when using ti001 for baud rate error calculation, it is not applicable. for details, see 7.6 (12) 16-bit ti mer/event counter 01 of 78k0/fc2. p. 219 hard ? selecting ti001 and ti011 pins are prohibited at pd78f0881a, 78f0882a, 78f0883a of the 78k0/fc2. selecting ti001 pin is prohibited at pd78f0884a, 78f0885a, 78f0886a, 78f0894a, 78f0895a of the 78k0/fc2. pp. 225 to 227, 229 to 231, 246, 259 to 272, 275, 276, 278, 280, 281, 283, 284, 286 even if tm0n is read, the value is not captured by cr01n. p. 225 tm0n: 16-bit timer counter 0n when tm0n is read, input of the count clock is temporarily stopped and it is resumed after the timer has been read. therefore, no clock miss occurs. p. 225 cr00n does not perform the capture operation when it is set in the comparison mode, even if a capt ure trigger is input to it. p. 226 set a value other than 0000h in cr00n in the mode in which clear & start occurs on a match of tm0n and cr00n. p. 227 if cr00n is cleared to 0000h in the free-running mode and in the clear mode using the valid edge of the ti00n pin, an interrupt request (inttm00n) is generated when the value of cr00n changes from 0000h to 0001h following tm0n overflow (ffffh). in addition, inttm00n is generated after a match between tm0n and cr00n, after detecting the valid edge of the ti01n pin, and the time r is cleared by a one-shot trigger. p. 227 when p01 or p06 is used as the valid edge input of the ti01n pin, it cannot be used as the timer output (to0n). mo reover, when p01 or p06 is used as to0n, it cannot be used as the valid edge input of the ti01n pin. p. 227 when cr00n is used as a capture regi ster, read data is undefined if the register read time and capture trigger input conflict (the capture data itself is the correct value). if count stop input and capture trigger input conflict, the captured data is undefined. p. 227 cr00n: 16-bit timer capture/compare registers 00n do not rewrite cr00n during tm0n operation p. 227 if the cr01n register is cleared to 0000h, an interrupt request (inttm01n) is generated when the value of cr01n changes from 0000h to 0001h following tm0n overflow (ffffh). in addition, inttm01n is generated after a match between tm0n and cr01n, after detecting the valid edge of the ti00n pin, and the time r is cleared by a one-shot trigger. p. 229 when cr01n is used as a capture regi ster, read data is undefined if the register read time and capture trigger input conflict (the capture data itself is the correct value). if count stop input and capture trigger input conflict, the captured data is undefined. p. 229 chapter 7 soft 16-bit timer/event counters 00, 01 cr01n: 16-bit timer capture/compare registers 01n cr01n can be rewritten during tm0n operation. for details, see 7.5.1 rewriting cr01n during tm0n operation. p. 229
appendix d list of cautions user?s manual u19180ej1v0ud 831 (8/32) cha p te r classification function details of function cautions page ? to capture the count value of the tm0n r egister to the cr00n register by using the phase reverse to that input to the ti00n pin, the interrupt request signal (inttm00n) is not generated after the value has been captured. if the valid edge is detected on the ti01n pin during this operation, the capture operation is not performed but the inttm00n signal is generated as an external interrupt signal. to not use the external interrupt, mask the inttm00n signal. p. 231 soft tmc0n: 16-bit timer mode control register 0n 16-bit timer/event counter 0n starts operation at the moment tmc0n2 and tmc0n3 are set to values other than 00 (operation stop mode), respectively. set tmc0n2 and tmc0n3 to 00 to stop the operation. p. 232 hard crc0n: capture/ compare control register 0n to ensure that the capture operation is performed properly, the capture trigger requires a pulse two cycles longer than the count clock selected by prescaler mode register 0n (prm0n). pp. 237 to 240 toc0n: 16-bit timer output control register 0n be sure to set toc0n using the following procedure. <1> set toc0n4 and toc0n1 to 1. <2> set only toe0n to 1. <3> set either of lvs0n or lvr0n to 1. p. 241 do not apply the following setting when setting the prm0n1 and prm0n0 bits to 11 (to specify the valid edge of the ti00n pin as a count clock). ? clear & start mode entered by the ti00n pin valid edge ? setting the ti00n pin as a capture trigger p. 246 soft if the operation of the 16-bit timer/event counter 0n is enabled when the ti00n or ti01n pin is at high level and when the valid edge of the ti00n or ti01n pin is specified to be the rising edge or both edges, the high level of the ti00n or ti01n pin is detected as a rising edge. no te this when the ti00n or ti01n pin is pulled up. however, the rising edge is not detected when the timer operation has been once stopped and then is enabled again. p. 246 hard prm0n: prescaler mode register 0n the valid edge of ti010 and timer output (to00) cannot be used for the p01 pin at the same time, and the valid edge of ti011 and timer output (to01) cannot be used for the p06 pin at the same time. select either of the functions. p. 246 interval timer cr00n cannot be rewritten during tm0n operation. p. 253 to change the value of the duty factor (the value of the cr01n register) during operation, see caution 2 in figure 7-35 ppg output operation timing. p. 256 values in the following range should be set in cr00n and cr01n: 0000h cr01n < cr00n ffffh p. 257 the cycle of the pulse generated through ppg output (cr00n setting value + 1) has a duty of (cr01n setting value + 1)/(cr00n setting value + 1). p. 257 cr00n cannot be rewritten during tm0n operation. p. 258 ppg output in the ppg output operation, change the pulse width (rewrite cr01n) during tm0n operation using the following procedure. <1> disable the timer output inversion operation by match of tm0n and cr01n (toc0n4 = 0) <2> disable the inttm01n interrupt (tmmk01n = 1) <3> rewrite cr01n <4> wait for 1 cycle of the tm0n count clock <5> enable the timer output inversion operation by match of tm0n and cr01n (toc0n4 = 1) <6> clear the interrupt request flag of inttm01n (tmif01n = 0) <7> enable the inttm01n interrupt (tmmk01n = 0) p. 258 to use two capture registers, set the ti00n and ti01n pins. p. 259 chapter 7 soft 16-bit timer/event counters 00, 01 pulse width measurement operations only 16-bit timer/event counter 00 can use the pulse width measurement of 78k0/fc2. pp. 259 to 269
appendix d list of cautions user?s manual u19180ej1v0ud 832 (9/32) chapter classification function details of function cautions page only 16-bit timer/event counter 00 can use the external event counter of 78k0/fc2. pp. 270 to 272 external event counter when reading the external event counter count value, tm0n should be read. p. 272 square-wave output operation cr00n cannot be rewritten during tm0n operation. p. 273 do not set the ospt0n bit while the one-shot pulse is being output. to output the oneshot pulse again, wait until the current one-shot pulse output is completed. p. 276 when using the one-shot pulse output of 16-bit timer/event counter 0n with a software trigger, do not change the level of the ti00n pin or its alternate-function port pin. because the external trigger is valid even in this case, the timer is cleared and started even at the level of the ti00n pin or its alternate-function port pin, resulting in the output of a pulse at an undesired timing. p. 276 do not set 0000h to the cr00n and cr01n registers. pp. 277, 280 16-bit timer counter 0n starts operati ng as soon as a value other than 00 (operation stop mode) is set to the tmc0n3 and tmc0n2 bits. pp. 278, 280 even if the external trigger is generated again while the one-shot pulse is output, it is ignored. pp. 278, 280 one-shot pulse output only 16-bit timer/event counter 00 can use the one-shot pulse output with external trigger of 78k0/fc2. pp. 278, 280 lvs0n, lvrn0 be sure to set lvs0n and lvr0n following steps <1>, <2>, and <3> above. step <2> can be performed after <1> and before <3>. p. 282 soft ? table 7-5 shows the restrictions for each channel. p. 283 hard timer start errors an error of up to one clock may occur in the time required for a match signal to be generated after timer start. this is because counting tm0n is started asynchronously to the count pulse. p. 283 set a value other than 0000h to cr00n and cr01n in clear & start mode entered upon a match between tm0n and cr00n (tm0n cannot count one pulse when it is used as an exter nal event counter). p. 283 when the valid edge is input to the ti00n/ti01n pin and the reverse phase of the ti00n pin is detected while cr00n/cr01n is read, cr01n performs a capture operation but the read value of cr00n/cr01n is not guaranteed. at this time, an interrupt signal (inttm00n/inttm01n) is generated when the valid edge of the ti00n/ti01n pin is detected (the interrupt signal is not generated when the reverse-phase edge of the ti00n pin is detected). when the count value is captured becaus e the valid edge of the ti00n/ti01n pin was detected, read the value of cr00n/cr01n after inttm00n/inttm01n is generated. p. 284 cr00n, cr01n: 16-bit timer capture/compar e registers 00n, 01n the values of cr00n and cr01n are not guaranteed after 16-bit timer/event counter 0n stops. p. 284 es0n0, es0n1 set the valid edge of the ti00n pin while the timer operation is stopped (tmc0n3 and tmc0n2 = 00). set the valid edge by using es0n0 and es0n1. p. 284 re-triggering one-shot pulse make sure that the trigger is not generat ed while an active level is being output in the one-shot pulse output mode. be sure to input the next trigger after the current active level is output. p. 284 the ovf0n flag is set to 1 in the followi ng case, as well as when tm0n overflows. select the clear & start mode entered upon a match between tm0n and cr00n. set cr00n to ffffh. when tm0n matches cr00n and tm0n is cleared from ffffh to 0000h p. 285 chapter 7 soft 16-bit timer/event counters 00, 01 ovf0n even if the ovf0n flag is cleared to 0 after tm0n overflows and before the next count clock is counted (before the value of tm0n becomes 0001h), it is set to 1 again and clearing is invalid. p. 285
appendix d list of cautions user?s manual u19180ej1v0ud 833 (10/32) chapter classification function details of function cautions page one-shot pulse output one-shot pulse output operates correctly in the free-running timer mode or the clear & start mode entered by the ti00n pin valid edge. the one-shot pulse cannot be output in the clear & start mode entered upon a match between tm0n and cr00n. p. 285 soft ti00n when the valid edge of ti00n is specified as the count clock, the capture register for which ti00n is specified as a trigger does not operate correctly. p. 286 ti00n, ti01n to accurately capture the count value, the pulse input to the ti00n and ti01n pins as a capture trigger must be wider than two count clocks selected by prm0n (see figure 7-5). p. 286 hard inttm00n, inttm01n the capture operation is performed at the falling edge of the count clock but the interrupt signals (inttm00n and inttm01n) are generated at the rising edge of the next count clock (see figure 7-15). p. 286 soft crc0n1 = 1 when the count value of the tm0n regi ster is captured to the cr00n register in the phase reverse to the signal input to the ti00n pin, the interrupt signal (inttm00n) is not generated after the count value is captured. if the valid edge is detected on the ti01n pin during this oper ation, the capture operation is not performed but the inttm00n signal is generat ed as an external interrupt signal. mask the inttm00n signal when the external interrupt is not used. p. 286 specifying valid edge after reset if the operation of the 16-bit timer/event counter 0n is enabled after reset and while the ti00n or ti01n pin is at high level and when the rising edge or both the edges are specified as the valid edge of t he ti00n or ti01n pin, then the high level of the ti00n or ti01n pin is detected as the rising edge. note this when the ti00n or ti01n pin is pulled up. however, the rising edge is not detected when the operation is once stopped and then enabled again. p. 286 sampling clock for eliminating noise the sampling clock for eliminating noi se differs depending on whether the valid edge of ti00n is used as the count clock or capture trigger. in the former case, the sampling clock is fixed to f prs . in the latter, the count clock selected by prm0n is used for sampling. when the signal input to the ti00n pin is sampled and the valid level is detected two times in a row, the valid edge is detec ted. therefore, noise having a short pulse width can be eliminated (see figure 7-15). p. 286 ti00n/ti01n the signal input to the ti00n/ti01n pi n is not acknowledged while the timer is stopped, regardless of the operation mode of the cpu. p. 286 since the composition of a timer i/o pin changes with products, the 16-bit timer/event counter 01 has the differenc e of function in a 16-bir timer/event counter00. the difference in the f unction by the produc t is shown below. p. 287 chapter 7 hard 16-bit timer/event counters 00, 01 16-bit timer/event counter 01 of 78k0/fc2 be careful to the following restrictions fo r function of 16-bit timer/event counter 01 for pd78f0881a, 78f0882a and 78f0883a. ? selecting ti001 and ti011 for count clock is prohibited. when using ti001 for baud rate error calculation, it is not applicable. ? timer output is prohibited. be careful to the following restrictions fo r function of 16-bit timer/event counter 01 for pd78f0884a, 78f0885a, 78f0886a, 78f0894a and 78f0895a. ? selecting ti001 for count clock is pr ohibited. when using ti001 for baud rate error calculation, it is not applicable. p. 287 in the mode in which clear & start occurs on a match of tm5n and cr5n (tmc5n6 = 0), do not write other values to cr5n during operation. p. 291 cr5n: 8-bit timer compare register 5n in pwm mode, make the cr5n rewrite period 3 count clocks of the count clock (clock selected by tcl5n) or more. p. 291 when rewriting tcl50 to other data, stop the timer operation beforehand. p. 293 tcl50: timer clock selection register 50 be sure to clear bits 3 to 7 to 0. p. 293 when rewriting tcl51 to other data, stop the timer operation beforehand. p. 294 chapter 8 soft 8-bit timer/event counters 50, 51 tcl51: timer clock selection register 51 be sure to clear bits 3 to 7 to 0. p. 294
appendix d list of cautions user?s manual u19180ej1v0ud 834 (11/32) chapter classification function details of function cautions page the settings of lvs5n and lvr5n are valid in other than pwm mode. p. 296 perform <1> to <4> below in the following order, not at the same time. <1> set tmc5n1, tmc5n6: operation mode setting <2> set toe5n to enable output: timer output enable <3> set lvs5n, lvr5n (see caution 1): timer f/f setting <4> set tce5n p. 296 tmc5n: 8-bit timer mode control register 5n (tmc5n) stop operation before rewriting tmc5n6. p. 296 interval timer do not write other values to cr5n during operation. p. 298 square-wave output do not write other values to cr5n during operation. p. 301 in pwm mode, make the cr5n rewrite period 3 count clocks of the count clock (clock selected by tcl5n) or more. p. 302 pwm output when reading from cr5n between <1> and <2> in figure 8-15, the value read differs from the actual value (read va lue: m, actual value of cr5n: n). p. 305 chapter 8 soft 8-bit timer/event counters 50, 51 timer start error an error of up to one clock may o ccur in the time required for a match signal to be generated after timer start. this is bec ause 8-bit timer counters 50 and 51 (tm50, tm51) are started asynchronously to the count clock. p. 306 cmp0n: 8-bit timer h comparer register 0n (cmp0n) cmp0n cannot be rewritten during time r count operation. cmp0n can be refreshed (the same value is writt en) during timer count operation. p. 310 cmp1n: 8-bit timer h compare register 1n (cmp1n) in the pwm output mode and carrier generator mode, be sure to set cmp1n when starting the timer count operation (tmhen = 1) after the timer count operation was stopped (tmhen = 0) (be sure to set again even if setting the same value to cmp1n). p. 310 when tmhe0 = 1, setting the other bits of tmhmd0 is prohibited. however, tmhmd0 can be refreshed (the same value is written). p. 313 tmhmd0: 8-bit timer h mode register 0 in the pwm output mode, be sure to set the 8-bit timer h compare register 10 (cmp10) when starting the timer count operation (tmhe0 = 1) after the timer count operation was stopped (tmhe0 = 0) (be sure to set again even if setting the same value to cmp10). p. 313 when tmhe1 = 1, setting the other bits of tmhmd1 is prohibited. however, tmhmd1 can be refreshed (the same value is written). p. 315 in the pwm output mode and carrier generator mode, be sure to set the 8-bit timer h compare register 11 (cmp11) when star ting the timer count operation (tmhe1 = 1) after the timer count operation was stopped (tmhe1 = 0) (be sure to set again even if setting the same value to cmp11). p. 315 tmhmd1: 8-bit timer h mode register 1 when the carrier generator mode is used, se t so that the count clock frequency of tmh1 becomes more than 6 times the count clock frequency of tm51. p. 315 soft tmcyc1: 8-bit timer h carrier register 1 do not rewrite rmc1 when tmhe = 1. however, tmcyc1 can be refreshed (the same value is written). p. 315 hard in pwm output mode, three operation clocks (signal selected using the cksn2 to cksn0 bits of the tmhmdn register) are required to transfer the cmp1n register value after rewriting the register. p. 321 be sure to set the cmp1n register when starting the timer count operation (tmhen = 1) after the timer count operation was stopped (tmhen = 0) (be sure to set again even if setting the same value to the cmp1n register). p. 321 chapter 9 soft 8-bit timers h0, h1 pwm output make sure that the cmp1n register se tting value (m) and cmp0n register setting value (n) are within the following range. 00h cmp1n (m) < cmp0n (n) ffh p. 322
appendix d list of cautions user?s manual u19180ej1v0ud 835 (12/32) chapter classification function details of function cautions page do not rewrite the nrzb1 bit again until at least the second clock after it has been rewritten, or else the transfer from the nrzb1 bit to the nrz1 bit is not guaranteed. p. 327 when the 8-bit timer/event counter 51 is used in the carrier generator mode, an interrupt is generated at the timing of <1 >. when the 8-bit timer/event counter 51 is used in a mode other than the carrier generator mode, the timing of the interrupt generation differs. p. 327 be sure to set the cmp11 register when starting the timer count operation (tmhe1 = 1) after the timer count operation was stopped (tmhe1 = 0) (be sure to set again even if setting the same value to the cmp11 register). p. 329 set so that the count clock frequency of tmh1 becomes more than 6 times the count clock frequency of tm51. p. 329 set the values of the cmp01 and cmp11 registers in a range of 01h to ffh. p. 329 in the carrier generator mode, three operating clocks (signal selected by cks12 to cks10 bits of tmhmd1 register) or more are required from when the cmp11 register value is changed to when the va lue is transferred to the register. p. 329 chapter 9 soft 8-bit timers h0, h1 carrier generator (8-bit timer h1 only) be sure to set the rmc1 bit before the count operation is started. p. 329 soft wtm: watch timer operation mode register do not change the count clock and interval time (by setting bits 4 to 7 (wtm4 to wtm7) of wtm) during watch timer operation. p. 336 chapter 10 hard watch timer interrupt request when operation of the watch timer and 5-bit counter is enabled by the watch timer mode control register (wtm) (by setting bits 0 (wtm0) and 1 (wtm1) of wtm to 1), the interval until the firs t interrupt request signal (intwt) is generated after the register is set does not exactly match the specification made with bits 2 and 3 (wtm2, wtm3) of wtm. subsequently, however, the intwt signal is generated at the specified intervals. p. 339 if a value other than ach is written to wdte, an internal reset signal is generated. if the source clock to t he watchdog timer is stopped, however, an internal reset signal is generated when t he source clock to the watchdog timer resumes operation. p. 342 if a 1-bit memory manipulation instruct ion is executed for wdte, an internal reset signal is generated. if the source clock to the watchdog timer is stopped, however, an internal reset signal is generated when the source clock to the watchdog timer resumes operation. p. 342 wdte: watchdog timer enable register the value read from wdte is 9ah/1ah (this differs from the written value (ach)). p. 342 the first writing to wdte after a reset re lease clears the watchdog timer, if it is made before the overflow time regardless of the timing of the writing, and the watchdog timer starts counting again. p. 343 if the watchdog timer is cleared by writing ?ach? to wdte, the actual overflow time may be different from the overflow time set by the option byte by up to 2/f rl seconds. p. 343 the watchdog timer can be cleared imm ediately before the count value overflows (ffffh). p. 343 the operation of the watchdog timer in the halt and stop modes differs as follows depending on the set value of bit 0 (lsrosc) of the option byte (see table on p. 344). if lsrosc = 0, the watchdog timer resumes counting after the halt or stop mode is released. at this time, the counter is not cleared to 0 but starts counting from the value at which it was stopped. if oscillation of the internal low-speed oscillator is stopped by setting lsrstop (bit 1 of the internal oscillation mode register (rcm) = 1) when lsrosc = 0, the watchdog timer stops operating. at this time, the counter is not cleared to 0. p. 344 chapter 11 soft watchdog timer operation control the watchdog timer continues its oper ation during self-programming and eeprom tm emulation of the flash memory. during processing, the interrupt acknowledge time is delayed. set the over flow time and window size taking this delay into consideration. p. 344
appendix d list of cautions user?s manual u19180ej1v0ud 836 (13/32) chapter classification function details of function cautions page the combination of wdcs2 = wdcs1 = wdcs0 = 0 and window1 = window0 = 0 is prohibited. pp. 345, 346 setting overflow time of watchdog timer, setting window open period of watchdog time the watchdog timer continues its oper ation during self-programming and eeprom emulation of the flash memory. during processing, the interrupt acknowledge time is delayed. set the ov erflow time and window size taking this delay into consideration. pp. 345, 346 the first writing to wdte after a reset re lease clears the watchdog timer, if it is made before the overflow time regardless of the timing of the writing, and the watchdog timer starts counting again. p. 346 chapter 11 soft watchdog timer setting window open period of watchdog timer setting window1 = window0 = 0 is prohibited when using the watchdog timer at 1.8 v v dd < 2.7 v. p. 346 set bcs1 and bcs0 when the buzzer output operation is stopped (bzoe = 0). p. 351 chapter 12 soft clock output/ buzzer output controller cks: clock output select register set ccs3 to ccs0 while the clock output operation is stopped (cloe = 0). p. 351 adcr: 10-bit a/d conversion register, adcrh: 8-bit a/d conversion register when data is read from adcr and adcrh, a wait cycle is generated. do not read data from adcr and adcrh when the cpu is operating on the subsystem clock and the peripheral hardware clock is stopped. for details, see chapter 31 cautions for wait. p. 355 a/d conversion must be stopped before rewriting bits fr0 to fr2, lv1, and lv0 to values other than the identical data. p. 357 adm: a/d converter mode register if data is written to adm, a wait cycle is generated. do not write data to adm when the cpu is operating on the subsystem clock and the peripheral hardware clock is stopped. for details, s ee chapter 31 cautions for wait. p. 357 set the conversion times wi th the following conditions. (see p. 358) p. 358 when rewriting fr2 to fr0, lv1, and lv0 to other than the same data, stop a/d conversion once (adcs = 0) beforehand. p. 358 change lv1 and lv0 from the default value, when 2.3 v av ref < 2.7 v. p. 358 a/d conversion timer selection the above conversion time does not in clude clock frequency errors. select conversion time, taking clock frequen cy errors into consideration. p. 358 when writing to the a/d converter m ode register (adm), analog input channel specification register (ads), and a/d por t configuration register (adpc), the contents of adcr may become undefined. read the conversion result following conversion completion before writ ing to adm, ads, and adpc. using timing other than the above may cause an incorrect conversion result to be read. p. 359 adcr: 10-bit a/d conversion register if data is read from adcr, a wait cycle is generated. do not read data from adcr when the cpu is operating on the subsystem clock and the peripheral hardware clock is stopped. for deta ils, see chapter 31 cautions for wait. p. 359 when writing to the a/d converter m ode register (adm), analog input channel specification register (ads), and a/d por t configuration register (adpc), the contents of adcrh may become undefined. read the conversion result following conversion completion before writ ing to adm, ads, and adpc. using timing other than the above may cause an incorrect conversion result to be read. p. 360 chapter 13 soft a/d converter adcrh: 8-bit a/d conversion register if data is read from adcrh, a wait cycle is generated. do not read data from adcrh when the cpu is operating on the subsystem clock and the peripheral hardware clock is stopped. for deta ils, see chapter 31 cautions for wait. p. 360
appendix d list of cautions user?s manual u19180ej1v0ud 837 (14/32) chapter classification function details of function cautions page be sure to clear bits 4 to 7 to ?0?. p. 361 because ads and adpc do not control i nput and output, set the channel used for a/d conversion in the input mode by using port mode register 8, 9 (pm8, pm9). if the channel is set in the output mode, selection of adpc is disabled. p. 361 do not set a pin to be used as a digita l input pin with adpc with ads. p. 361 ads: analog input channel specification register if data is written to ads, a wait cycle is generated. do not write data to ads when the cpu is operating on the subsystem clock and the peripheral hardware clock is stopped. for details, see chapter 31 cautions for wait. p. 361 set the channel used for a/d conversion to the input mode by using port mode register 8 (pm8) and port mode register 9 (pm9). p. 363 do not set the pin set by adpc as digi tal i/o by analog input channel specification register (ads). p. 363 adpc: a/d port configuration register (adpc) if data is written to adpc, a wait cycle is generated. do not write data to adpc when the cpu is operating on the subsystem clock and the peripheral hardware clock is stopped. for details, s ee chapter 31 cautions for wait. p. 363 basic operations of a/d converter make sure the period of <1> to <5> is 1 s or more. p. 366 make sure the period of <1> to <5> is 1 s or more. p. 371 <1> may be done between <2> and <4>. p. 371 <1> can be omitted. however, ignore data of the first conversion after <5> in this case. p. 371 a/d conversion operation the period from <6> to <9> differs from t he conversion time set using bits 5 to 1 (fr2 to fr0, lv1, lv0) of adm. the period from <8> to <9> is the conversion time set using fr2 to fr0, lv1, and lv0. p. 371 soft operating current in stop mode the a/d converter stops operating in the st op mode. at this time, the operating current can be reduced by clearing bit 7 (adcs) and bit 0 (adce) of the a/d converter mode register (adm) to 0. to restart from the standby status, clear bit 0 (adif) of interrupt request flag regist er 1l (if1l) to 0 and start operation. p. 374 hard input range of ani0 to ani15 observe the rated range of the ani0 to ani15 input voltage. if a voltage of av ref or higher and av ss or lower (even in the range of absolute maximum ratings) is input to an analog input channel, the conv erted value of that channel becomes undefined. in addition, the converted va lues of the other channels may also be affected. p. 374 conflict between a/d conversion result register (adcr, adcrh) write and adcr or adcrh read by instruction upon the end of conversion adcr or adcrh read has priority. after the read operation, t he new conversion result is written to adcr or adcrh. p. 374 soft conflicting operations conflict between adcr or adcrh write and a/d converter mode register (adm) write, analog input channel spec ification register (ads), or a/d port configuration register (adpc) write upon the end of conversion adm, ads, or adpc write has priority . adcr or adcrh write is not performed, nor is the conversion end inte rrupt signal (intad) generated. p. 374 chapter 13 hard a/d converter noise countermeasures to maintain the 10-bit resolution, attention must be paid to noise input to the av ref pin and pins ani0 to ani15. <1> connect a capacitor with a low equivalent resistance and a good frequency response to the power supply. <2> the higher the output impedance of t he analog input source, the greater the influence. to reduce the noise, connecti ng external c as shown in figure 13- 21 is recommended. <3> do not switch these pins wi th other pins during conversion. <4> the accuracy is improved if the halt mode is set immediately after the start of conversion. p. 374
appendix d list of cautions user?s manual u19180ej1v0ud 838 (15/32) chapter classification function details of function cautions page the analog input pins (ani0 to ani15) are also used as i/o port pins (p80 to p87, p90 to p97). when a/d conversion is performed with any of ani0 to ani15 selected, do not access p80 to p87, p90 to p97 while c onversion is in progress; otherwise the conversion resolution may be degraded. it is recommended to select pins used as p80 to p87, p90 to p97 starting with the p80/ani0 that is the furthest from av ref . p. 375 p80/ani0 to p87/ani7, p90/ani8 to p97/ani15 if a digital pulse is applied to the pins adj acent to the pins currently used for a/d conversion, the expected value of the a/d conversion may not be obtained due to coupling noise. therefore, do not apply a pulse to the pins adjacent to the pin undergoing a/d conversion. p. 375 input impedance of ani0 to ani7 pins this a/d converter charges a sampling capacitor for sampling during sampling time. therefore, only a leakage current flows when sampling is not in progress, and a current that charges the capacitor flow s during sampling. consequently, the input impedance fluctuates depending on whether sa mpling is in progress, and on the other states. to make sure that sampling is effectiv e, however, it is recommended to keep the output impedance of the analog input source to within 10 k , and to connect a capacitor of about 100 pf to the ani0 to ani15 pins (see figure 13-21). p. 375 hard av ref pin input impedance a series resistor string of several tens of k is connected between the av ref and av ss pins. therefore, if the output impedance of the reference voltage source is high, this will result in a series connection to the series resistor string between the av ref and av ss pins, resulting in a large reference voltage error. p. 375 interrupt request flag (adif) the interrupt request flag (adif) is not cleared even if the analog input channel specification register (a ds) is changed. therefore, if an analog input pin is changed during a/d conversion, the a/d c onversion result and adif for the pre- change analog input may be set just before the ads rewrite. caution is therefore required since, at this time, when adif is read immediately after the ads rewrite, adif is set despite the fact a/d c onversion for the post-change analog input has not ended. when a/d conversion is stopped and then resumed, clear adif before the a/d conversion operation is resumed. p. 376 conversion results just after a/d conversion start the first a/d conversion val ue immediately after a/d conversion starts may not fall within the rating range if the adcs bit is set to 1 within 1 s after the adce bit was set to 1, or if the adcs bit is set to 1 with the adce bit = 0. take measures such as polling the a/d conversion end interrupt request (intad) and removing the first conversion result. p. 376 a/d conversion result register (adcr, adcrh) read operation when a write operation is performed to t he a/d converter mode register (adm), analog input channel specification regist er (ads), and a/d port configuration register (adpc), the contents of adcr and adcrh may become undefined. read the conversion result following conver sion completion before writing to adm, ads, and adpc. using a timing other than the above may cause an incorrect conversion result to be read. p. 376 chapter 13 soft a/d converter internal equivalent circuit the equivalent circuit of the analog input block is shown below. (see figure 13-23 and table 13-4) p. 377 the txd6n output inversion function inve rts only the transmission side and not the reception side. to use this function, t he reception side must be ready for reception of inverted data. p. 378 chapter 14 soft serial interface uart60, uart61 uart mode iif clock supply to serial interfaces uart60 and uart61 are not stopped (e.g., in the halt mode), normal operation continues. if clock supply to serial interfaces uart60 and uart61 are stopped (e.g., in t he stop mode), each register stops operating, and holds the value immediatel y before clock supply was stopped. the txd6n pins also holds the value imm ediately before clo ck supply was stopped and outputs it. however, the operation is not guaranteed after clock supply is resumed. therefore, reset the circuit by setting power6n = 0, rxe6n = 0, and txe6n = 0. p. 378
appendix d list of cautions user?s manual u19180ej1v0ud 839 (16/32) chapter classification function details of function cautions page set power6n = 1 and then set txe6n = 1 (transmission) or rxe6n = 1 (reception) to start communication. p. 378 txe6n and rxe6n are synchronized by the base clock (f xclk6 ) set by cksr6n. to enable transmission or reception again, se t txe6n or rxe6n to 1 at least two clocks of the base clock after txe6n or rxen6 has been cleared to 0. if txe6n or rxe6n is set within two clocks of the base clock, the transmission circuit or reception circuit may not be initialized. p. 378 set transmit data to txb6n at least one base clock (f xclk6 ) after setting txe6n = 1. p. 378 chapter 14 soft serial interface uart60, uart61 uart mode if data is continuously trans mitted, the communication ti ming from the stop bit to the next start bit is extended two operating clocks of the macro. however, this does not affect the result of communica tion because the recept ion side initializes the timing when it has detected a star t bit. do not use the continuous transmission function if the interface is used in lin communication operation. p. 379 do not write data to txb6n when bit 1 (t xbf6n) of asynchronous serial interface transmission status regist er 6n (asif6n) is 1. p. 387 do not refresh (write the same value to) txb6n by software during a communication operation (when bits 7 and 6 (power6n, txe6n) of asynchronous serial interface operation m ode register 6n (asim6n) are 1 or when bits 7 and 5 (power6n, rxe6n) of asim6n are 1). p. 387 txb6n: transmit buffer register 6n set transmit data to txb6n at least one base clock (f xclk6 ) after setting txe6n = 1. p. 387 to start the transmission, set power6n to 1 and then set txe6n to 1. to stop the transmission, clear txe6n to 0, and then clear power6n to 0. pp. 390, 392 to start the reception, set power6n to 1 and then set rxe6n to 1. to stop the reception, clear rxe6n to 0, and then clear power6n to 0. pp. 390, 392 set power6n to 1 and then set rxe6n to 1 while a high level is input to the rxd6n pins. if power6n is set to 1 and r xe6n is set to 1 while a low level is input, reception is started. pp. 390, 392 txe6n and rxe6n are synchronized by the base clock (f xclk6 ) set by cksr6n. to enable transmission or reception again, se t txe6n or rxe6n to 1 at least two clocks of the base clock after txe6n or rxe6n has been cleared to 0. if txe6n or rxe6n is set within two clocks of the base clock, the transmission circuit or reception circuit may not be initialized. pp. 390, 392 set transmit data to txb6n at least one base clock (f xclk6 ) after setting txe6n = 1. pp. 390, 392 clear the txe6n and rxe6n bits to 0 before rewriting the ps61n, ps60n, and cl6n bits. pp. 390, 392 fix the ps61n and ps60n bits to 0 when used in lin communication operation. pp. 390, 392 clear txe6n to 0 before rewriting the sl6n bit. reception is always performed with ?the number of stop bits = 1?, and ther efore, is not affected by the set value of the sl6n bit. pp. 390, 392 asim6n: asynchronous serial interface operation mode register 6n make sure that rxe6n = 0 when rewriting the isrm6n bit. pp. 390, 392 the operation of the pe6n bit differs depending on the set values of the ps61n and ps60n bits of asynchronous serial interface operation mode register 6n (asim6n). pp. 393, 394 the first bit of the receive data is c hecked as the stop bit, regardless of the number of stop bits. pp. 393, 394 if an overrun error occurs, the next receiv e data is not written to receive buffer register 6n (rxb6n) but discarded. pp. 393, 394 chapter 14 soft serial interface uart60, uart61 asis6n: asynchronous serial interface reception error status register 6n if data is read from asis6n, a wait cycle is generated. do not read data from asis6n when the cpu is operating on the subsystem clock and the high-speed system clock is stopped. for details, see chapter 31 cautions for wait. pp. 393, 394
appendix d list of cautions user?s manual u19180ej1v0ud 840 (17/32) chapter classification function details of f unction cautions page to transmit data continuously, write the firs t transmit data (first byte) to the txb6n register. be sure to check that the txbf 6n flag is ?0?. if so, write the next transmit data (second byte) to the txb6n register. if data is written to the txb6n register while the txbf6n flag is ?1?, t he transmit data cannot be guaranteed. pp. 395, 396 asif6n: asynchronous serial interface transmission status register 6n to initialize the transmission unit upon co mpletion of continuous transmission, be sure to check that the txsf6n flag is ?0? after generation of the transmission completion interrupt, and then execute initia lization. if initia lization is executed while the txsf6n flag is ?1?, t he transmit data cannot be guaranteed. pp. 395, 396 cksr6n: clock selection register 6n make sure power6n = 0 when rewriting tps63n to tps60n. pp. 398, 399 soft make sure that bit 6 (txe6n) and bit 5 (rxe6n) of the asim6n register = 0 when rewriting the mdl67n to mdl60n bits. pp. 400, 401 hard brgc6n: baud rate generator control register 6n the baud rate is the output clock of the 8-bit counter divided by 2. pp. 400, 401 asicl6n can be refreshed (the same value is written) by software during a communication operation (when bits 7 and 6 (power6n, txe6n) of asim6n = 1 or bits 7 and 5 (power6n, rxe6n) of asim6n = 1). however, do not set both sbrt6n and sbtt6n to 1 by a refr esh operation during sbf reception (sbrt6n = 1) or sbf transmission (unt il intst6n occurs since sbtt6n has been set (1)), because it may re-trigger sbf reception or sbf transmission. p. 402 in the case of an sbf reception error, the mode returns to the sbf reception mode. the status of the sbrf6n flag is held (1). pp. 403, 405 before setting the sbrt6n bit, make sure that bit 7 (power6n) and bit 5 (rxe6n) of asim6n = 1. after setting the sbrt6n bit to 1, do not clear it to 0 before sbf reception is completed ( before an interrupt request signal is generated). pp. 403, 405 the read value of the sbrt6n bit is alwa ys 0. sbrt6n is automatically cleared to 0 after sbf reception has been correctly completed. pp. 403, 405 before setting the sbtt6n bit to 1, make sure that bit 7 (power6n) and bit 6 (txe6n) of asim6n = 1. after setting the sbtt6n bit to 1, do not clear it to 0 before sbf transmission is completed ( before an interrupt request signal is generated). pp. 403, 405 the read value of the sbtt6n bit is alwa ys 0. sbtt6n is automatically cleared to 0 at the end of sbf transmission. pp. 403, 405 do not set the sbrt6n bit to 1 during reception, and do not set the sbtt6n bit to 1 during transmission. pp. 403, 405 before rewriting the dir6n and txdlv6n bits, clear the txe6n and rxe6n bits to 0. pp. 403, 405 asicl6n: asynchronous serial interface control register 6n when the txdlv6n bit is set to 1 (inv erted txd6n output), the txd6n/p13 or txd61/sck10/p10 pins cannot be used as a general-purpose port, regardless of the settings of power6n and txe 6n. when using the txd6n/p13 or txd61/sck10/p10 pins pin as a general- purpose port, clear the txdlv6n bit to 0 (normal txd6n output). pp. 403, 405 power6n, txe6n, rxe6n: bits 7, 6, 5 of asim6n clear power6n to 0 after clearing txe6n and rxe6n to 0 to stop the operation. to start the communication, set power6n to 1, and then set txe6n and rxe6n to 1. p. 408 uart mode take relationship with the other party of communication when setting the port mode register and port register. p. 409 chapter 14 soft serial interface uart60, 61 parity types and operation fix the ps61n and ps60n bits to 0 when the device is used in lin communication operation. p. 413
appendix d list of cautions user?s manual u19180ej1v0ud 841 (18/32) chapter classification function details of f unction cautions page the txbf6n and txsf6n flags of the asif6n register change from ?10? to ?11?, and to ?01? during continuous transmission. to check the status, therefore, do not use a combination of the txbf6n and txsf6n flags for judgment. read only the txbf6n flag when executing continuous transmission. p. 415 when the device is used in lin comm unication operation, the continuous transmission function cannot be used. ma ke sure that asynchronous serial interface transmission status register 6n (asif6n) is 00h bef ore writing transmit data to transmit buffer register 6n (txb6n). p. 415 to transmit data continuously, write the first transmit data (first byte) to the txb6n register. be sure to check that the txbf6n flag is ?0?. if so, write the next transmit data (second byte) to the txb6n register. if data is written to the txb6n register while the txbf6n flag is ?1?, t he transmit data cannot be guaranteed. p. 415 to initialize the transmission unit upon co mpletion of continuous transmission, be sure to check that the txsf6n flag is ?0? after generation of the transmission completion interrupt, and then execute initia lization. if initializ ation is executed while the txsf6n flag is ?1?, t he transmit data cannot be guaranteed. p. 415 continuous transmission during continuous transmission, an overrun error may occur, which means that the next transmission was completed befor e execution of intst6n interrupt servicing after transmission of one data fr ame. an overrun error can be detected by developing a program that can count the number of transmit data and by referencing the txsf6n flag. p. 415 if a reception error occurs, read asis6n and then rxb6n to clear the error flag. otherwise, an overrun error will occur when the next data is received, and the reception error status will persist. p. 419 reception is always performed with the ? number of stop bits = 1?. the second stop bit is ignored. p. 419 normal reception be sure to read asynchronous serial inte rface reception error status register 6n (asis6n) before reading rxb6n. p. 419 keep the baud rate error during transmission to within the permissible error range at the reception destination. p. 426 error of baud rate make sure that the baud rate error during reception satisfies the range shown in (4) permissible baud rate range during reception. p. 426 chapter 14 soft serial interface uart60, 61 permissible baud rate range during reception make sure that the baud rate error during reception is within the permissible error range, by using the calculat ion expression shown below. p. 427 do not access sotb1n when csot1n = 1 ( during serial communication). p. 432 sotb1n: transmit buffer register 1n in the slave mode, transmission/recepti on is started when data is written to sotb11 with a low level input to the ssi11 pin. for details of the transmission/reception operation, see 15.4.2 (2) communication operation. p. 432 do not access sio1n when csot1n = 1 ( during serial communication). p. 432 sio1n: serial i/o shift register 1n in the slave mode, reception is started when data is read from sio11 with a low level input to the ssi11 pin. for details of the reception operation, see 15.4.2 (2) communication operation. p. 432 csim10: serial operation mode register 10 be sure to clear bit 5 to 0. p. 433 do not write to csic10 while csie10 = 1 (operation enabled). p. 436 to use p10/sck10/t x d61 and p12/so10 as general- purpose ports, set csic10 in the default status (00h). p. 436 csic10: serial clock selection register 10 the phase type of the data clock is type 1 after reset. p. 436 do not write to csic11 while csie11 = 1 (operation enabled). p. 438 to use p74/so11 and p76/sck11 as gener al-purpose ports, set csic11 in the default status (00h). p. 438 chapter 15 soft serial interface csi10, csi11 csic11: serial clock selection register 11 the phase type of the data clock is type 1 after reset. p. 438
appendix d list of cautions user?s manual u19180ej1v0ud 842 (19/32) chapter classification function details of f unction cautions page 3-wire serial i/o mode take rela tionship with the other party of communication when setting the port mode register and port register. p. 442 do not access the control register and data register when csot1n = 1 (during serial communication). p. 445 communication operation when using serial interface csi11, wait for the duration of at least one clock before the clock operation is started to change the level of the ssi11 pin in the slave mode; otherwise, malfunctioning may occur. p. 445 chapter 15 soft serial interface csi10, csi11 so1n output if a value is written to csie1n, trmd1n, dap1n, and dir1n, the output value of so1n changes. p. 453 overview of functions to use the ca n controller, set p70 to 1. p. 455 id28 to id18 are identifiers. p. 460 an identifier is transmitted msb first. p. 460 arbitration field id28 to id0 are identifiers. p. 460 data length in the remote frame, there is no data field even if the data length code is not 0000b. p. 461 bus priority if the extended-format data frame and the standard-format remote frame conflict on the bus (if id28 to id18 of both of them are the same), the standard-format remote frames takes priority. p. 468 bit error if an error occurs, the error flag output (active or passive) is controlled according to the contents of the transmission erro r counter and reception error counter before the error occurred. the value of the error counter is incremented after the error flag has been output. p. 472 if the bus-off recovery sequence is inte rrupted by entering initialization mode and re-entering any operation mode, the bus-off recovery sequence will restart from the beginning, and the waiting phase will be again 128 times 11 recessive-level bits, c ounted from this point. p. 473 recovery operation from bus-off state through normal recovery sequence in the bus-off recovery sequence, re c [6:0] counts up (+1) each time 11 consecutive recessive-level bits hav e been detected. even during the bus-off period, the can module can enter the can sleep mode or can stop mode. to start the bus-off recovery sequence, it is nec essary to transit to the initialization mode once. however, when the can module is in either can sleep mode or can stop mode, transition request to the initialization mode is not accepted, thus you have to release the can sleep mode first. in this case, as soon as the can sleep mode is released, the bus -off recovery sequence starts and no transition to initialization mode is nec essary. if the can module detects a dominant edge on the can bus while in sleep mode even during bus-off, the sleep mode will be left and the bus-off recovery sequence will start (in the state that the can clock is supplied, it is necessary to clear the psmode by software after dominant edge detection). p. 473 forced recovery operation that skips bus-off recovery sequence this function is not defined by the ca n protocol iso 11898. when using this function, thoroughly evaluate its effect on the network system. p. 474 this function is enabled only in the initia lization mode. even if the ccerc bit is set to 1 in a can operation mode, the c0erc and c0info registers are not initialized. p. 474 initializing can module error counter register (c0erc) in initialization mode the ccerc bit can be set at the same time as the request to enter a can operation mode. p. 474 ipt of the can controller is 0tq. to conf orm to the can protoc ol specification, therefore, a length equal to phase segment 1 must be set here. this means that the length of time segment 1 minus 1tq is the settable upper limit of time segment 2. p. 475 chapter 16 soft can controller segment setting the length of time segment 1 minus 1tq or 4 tq, whichever is smaller. p. 475
appendix d list of cautions user?s manual u19180ej1v0ud 843 (20/32) chapter classification function details of f unction cautions page register bit configuration the actual register address is calculated as follows: register address = global register area offset (ch dependent) + offset address as listed in table above pp. 490 to 493 while the mbon bit is cleared (to 0), software access to the message buffers (c0mdata0m, c0mdata1m, c0mdata01m, c0mdata2m, c0mdata3m, c0mdata23m, c0mdata4m, c0mdata5m, c0mdata45m, c0mdata6m, c0mdata7m, c0mdata67m, c0mdlcm, c0mconfm, c0midlm, c0midhm, and c0mctrlm), or registers re lated to transmit history or receive history (c0lopt, c0tgpt, c0li pt, and c0rgpt) is disabled. p. 496 this bit is read-only. even if 1 is written to mbon while it is 0, the value of mbon does not change, and access to the message buffer registers, or registers related to transmit history or receive history remains disabled. p. 496 to request forced shutdown, the gom bit must be cleared to 0 in a subsequent, immediately following write access after the efsd bit has been set to 1. if access to another regi ster (including reading the c0gmctrl register) is executed without clearing t he gom bit immediately after the efsd bit has been set to 1, the efsd bit is forcibly cleared to 0, and the forced shutdown request is invalid. p. 497 the gom bit can be cleared only in the in itialization mode or immediately after efsd bit is set (to 1). p. 497 c0gmctrl: can global control register set gom bit and esfd bit always separately. p. 497 before changing the normal operation m ode with abt to the initialization mode, be sure to set the c0gmabt register to the default value (0000h) and confirm the c0gmabt register is su rely initialized to the default value (0000h). p. 499 do not set the abttrg bit (abttrg = 1) in the initialization mode. if the abttrg bit is set in the initialization mode, the operation is not guaranteed after the can module has entered the normal operation mode with abt. do not set the abttrg bit (1) while the c0ctrl.tstat bit is set (1). confirm tstat = 0 directly in advance before setting abttrg bit. p. 499 c0gmabt: can global automatic block transmission control register while receiving a message from anot her node or transmitting the messages other than the abt messages (message buffer 8 to 15), there is a possibility not to begin immediately t he transmission even if the abttrg bit is set to 1. transmission is not aborted even if the abttrg bit is cleared to 0, until the transmission of the abt message, whic h is currently being transmitted is completed (successfully or not). a fter that, the transmission is aborted. p. 500 do not change the contents of the c0gmabtd register while the abttrg bit is set to 1. p. 501 c0gmabtd: can global automatic block transmission delay setting register the timing at which the abt message is actually transmitted onto the can bus differs depending on the status of tr ansmission from the other station or how a request to transmit a message other than an abt message (message buffers 8 to 15) is made. p. 501 transition to and from the can stop mode must be made via can sleep mode. a request for direct transition to and from the can stop mode is ignored. p. 506 the mbon flag of c0gmctrl must be c hecked after releasing a power save mode, prior to access the message buffers again. p. 506 can sleep mode requests are kept pending, until cancelled by software or entered on appropriate bus condition (bus idle). software can check the actual status by reading psmode. p. 506 chapter 16 soft can controller c0ctrl: can module control register transit to initialization mode or power saving modes may take some time. be sure to verify the success of m ode change by reading the values, before proceeding. p. 506
appendix d list of cautions user?s manual u19180ej1v0ud 844 (21/32) chapter classification function details of f unction cautions page c0ints: can module interrupt status register please clear the status bit of this regist er with software when the confirmation of each status is necessary in the interrupt processing, because these bits are not cleared automatically. p. 513 c0brp: can module bit rate prescaler register the c0brp register can be write-accessed only in the initialization mode. p. 514 be sure to set bits 7 to 4 0000b. p. 525 c0mdlcm: can message data length register m receive data is stored in as many c0mdataxm as the number of bytes (however, the upper limit is 8) corres ponding to dlc of the received frame. c0mdataxm in which no dat a is stored is undefined. p. 525 c0mconfm: can message configuration register be sure to write 0 to bits 2 and 1. p. 527 be sure to write 0 to bits 14 and 13 of the c0midhm register. p. 527 c0midlm, c0midhm: can message id register m be sure to align the id value accordi ng to the given bit positions into this registers. note that for standard id, the id value must be shifted to fit into id28 to id11 bit positions. p. 527 do not set the trq bit and the rdy bit (1) at the same time. set the rdy bit (1) before setting the trq bit. p. 529 do not clear the rdy bit (0) duri ng message transmission. follow the transmission abort process about clearing the rdy bit (0) for redefinition of the message buffer. p. 529 clear again when rdy bit is not cleared even if this bit is cleared. p. 529 be sure that rdy is cleared before writing to the message buffer registers. perform this confirmation by reading back the rdy bit. however, setting the trq bit, clearing the dn bit, setting the rdy bit or clearing the mow bit of the c0mctrlm register need not be confirmed. p. 529 set ie bit and rdy bit always separately. p. 529 do not set the dn bit to 1 by software. be sure to write 0 to bit 10. p. 529 while receiving a message from anot her node or transmitting the messages, there is a possibility of not to begin immediately the transmission even if the trq bit is set to 1. the transmission is not aborted even if the trq bit is cleared to 0. the transmission is c ontinued if a message is currently being transmitted and until the transmission is completed (successfully or not). p. 530 c0mctrlm: can message control register m set ie bit and rdy bit always separately. p. 530 when a message is received, reception filt ering is performed in accordance with the id and mask set to each receive mess age buffer. if the procedure in figure 16-40 is not observed, the contents of the message buffer after it has been redefined may contradict the result of rec eption (result of reception filtering). if this happens, check that the id and id e received first and stored in the message buffer following redefinition are those stored after the message buffer has been redefined. if no id and ide are stored after redefinition, redefine the message buffer again. p. 532 chapter 16 soft can controller redefinition of message buffer when a message is transmitted, the tr ansmission priority is checked in accordance with the id, ide, and rtr bi ts set to each transmit message buffer to which a transmission request was se t. the transmit message buffer having the highest priority is selected for trans mission. if the procedure in figure 16-41 is not observed, a message with an id not having the highest priority may be transmitted after redefinition. p. 532
appendix d list of cautions user?s manual u19180ej1v0ud 845 (22/32) chapter classification function details of f unction cautions page receive history list function if the history list is in the overflow c ondition (rovf is set), reading the history list contents is still possible, until the history list is empty (indicated by rhpm flag set). nevertheless, the history list remains in the overflow condition, until rovf is cleared by software. if rovf is not cleared, the rhpm flag will also not be updated (cleared) upon a message st orage of newly received frame. this may lead to the situation, that rhpm indicates an empty history list, although a reception has taken place, while the history list is in the overflow state (rovf and rhpm are set). p. 536 mbrb can be configured for each of the same message buffer types. therefore, even if a message buffer of another mbrb whose id matches but whose message buffer type is different has a vacancy, the received message is not stored in that message buffer, but instead discarded. p. 540 mbrb does not have a ring buffer structur e. therefore, after a message is stored in the message buffer having the highest number in the mbrb configuration, a newly received message will not be stored in the message buffer having the lowest message buffer number. p. 540 mbrb operates based on the recepti on and storage conditions; there are no settings dedicated to mbrb, such as f unction enable bits. by setting the same message buffer type and id to two or more message buffers, mbrb is automatically configured. p. 540 with mbrb, "matching id" means "matchi ng id after mask". even if the id set to each message buffer is not the same, if the id that is masked by the mask register matches, it is cons idered a matching id and the buffer that has this id is treated as the storage destination of a message. p. 540 multi buffer receive block function the priority between mbrbs is mentioned in 16.9.1 message reception. p. 540 remote frame reception when a message buffer is searched for re ceiving and storing a remote frame, overwrite control by the ows bit of the c0mconfm register of the message buffer and the dn bit of the c0mctrlm register are not affected. the setting of ows is ignored, and dn is set in any case. if more than one transmit message buffer has the same id and the id of the received remote frame matches that id, the remote frame is stored in the transmit message buffer with the lowest message buffer number. p. 541 transmit history list function if the history list is in the overflow condi tion (tovf is set), reading the history list contents is still possible, until the history list is empty (indicated by thpm flag set). nevertheless, the history list rema ins in the overflow condition, until tovf is cleared by software. if tovf is not cleared, the thpm flag will also not be updated (cleared) upon successful transmissi on of a new message. this may lead to the situation, that thpm i ndicates an empty history list, although a successful transmission has taken place, while the history list is in the overflow state (tovf and thpm are set). p. 544 set the abtclr bit to 1 while the abttrg bit is cleared to 0 in order to resume abt operation at buffer no.0. if the abtclr bit is set to 1 while the abttrg bit is set to 1, the subs equent operation is not guaranteed. p. 547 if the automatic block transmission engine is cleared by setting the abtclr bit to 1, the abtclr bit is automatically cleared immediately a fter the processing of the clearing request is completed. p. 547 do not set the abttrg bit in the initialization mode. if the abttrg bit is set in the initialization mode, the proper operat ion is not guaranteed after the mode is changed from the initialization mode to the abt mode. p. 547 chapter 16 soft can controller automatic block transmission (abt) do not set trq bit of the abt message buffers to 1 by software in the normal operation mode with abt. otherwise, the operation is not guaranteed. p. 547
appendix d list of cautions user?s manual u19180ej1v0ud 846 (23/32) chapter classification function details of f unction cautions page the c0gmabtd register is used to set t he delay time that is inserted in the period from completion of the preceding abt message to setting of the trq bit for the next abt message when the transmi ssion requests are set in the order of message numbers for each message for abt that is successively transmitted in the abt mode. the timing at whic h the messages are ac tually transmitted onto the can bus varies depending on the status of transmission from other stations and the status of the setting of the transmission request for messages other than the abt messages (message buffer 8 to 15). p. 547 if a transmission request is made for a message other than an abt message and if no delay time is inserted in the in terval in which tr ansmission requests for abt are automatically set (c0gmabt d = 00h), messages other than abt messages may be transmitted not dependi ng on the priority of the abt message. p. 547 do not clear the rdy bit to 0 when abttrg = 1. p. 547 automatic block transmission (abt) if a message is received from another node while normal operation mode with abt is active, the tx-message from the abt-area may be transmitted with delay of one frame although c0gmabtd register was set up with 00h. p. 547 transmission abort process be sure to abort abt by clearing abttr g to 0. the operation is not guaranteed if aborting transmission is r equested by clearing rdy bit. p. 548 even if the falling edge belongs to the so f of a receive message, this message will not be received and stored. if the cpu has turned off the clock to the can while the can was in sleep mode, even subsequently the can sleep mode will not be released and psmode [1:0] will continue to be 01b unless the clock to the can is supplied again. in addition to this, the receive message will not be received after that. p. 550 if the falling edge on the can reception pin ( crxd) is detected in the state that the can clock is supplied, it is necessa ry to clear the psmode0 bit by software (for details, refer to the processing in figure 16-54). p. 550 releasing can sleep mode be aware that the release of can sl eep mode by can bus event, and thus the wake up interrupt may happen at any time, even right after requesting sleep mode, if a can bus event occurs. p. 550 can stop mode to set the can module to the can stop mode, the module must be in the can sleep mode. to confirm that the module is in the sleep mode, check that psmode [1:0] = 01b, and then request the can stop mode. if a bus change occurs at the can reception pin (crxd) while this process is being performed, the can sleep mode is automatically released. in this case, the can stop mode transition request cannot be acknowl edged (however, in the state that the can clock is supplied, it is necessary to clear the psmode0 bit by software after a bus change occurs at the can reception pin (crxd)). p. 551 receive-only mode if only two can nodes are c onnected to the can bus and one of them is operating in the receive-only mode, there is no ack on the can bus. due to the missing ack, the transmitting node will transmit an active error flag, and repeat transmitting a message frame. the transmitting node becomes error passive after transmitting the message fr ame 16 times (assuming that the error counter was 0 in the beginning and no other errors have occurred). after the message frame for the 17th ti me is transmitted, the transmitting node generates a passive error flag. the receiving node in the receive-only mode detects the first valid message frame at th is point, and the valid bit is set to 1 for the first time. p. 555 chapter 16 soft can controller single-shot mode the al bit is only valid in si ngle-shot mode. it does not influence the operation of retransmission upon arbitration lo ss in the other operation modes. p. 555
appendix d list of cautions user?s manual u19180ej1v0ud 847 (24/32) chapter classification function details of f unction cautions page time stamp function the time stamp function using tslock bit is to stop toggle of tsout bit by receiving a data frame in message buffer 0. therefore, message buffer 0 must be set as a receive message buffer. since a receive message buffer cannot receive a remote frame, toggle of tsout bit cannot be stopped by reception of a remote frame. toggle of tsout bit does not stop when a data frame is received in a message buffer other than message buffer 0. for these reasons, a data frame cannot be received in message buffer 0 when the can module is in the normal operation mode with abt, because message buffer 0 must be set as a transmit message buffer. in this operation mode, therefore, the function to stop toggle of tsout bi t by tslock bit cannot be used. p. 559 settable bit rate combinations the values in table 16-22 do not guarantee the operation of the network system. thoroughly check the effect on the network system, taking into consideration oscillation errors and delays of the can bus and can transceiver. p. 563 representative examples of baud rate settings (fcanmod = 8 mhz) the values in table 16-23 do not guarantee the operation of the network system. thoroughly check the effect on the network system, taking into consideration oscillation errors and delays of the can bus and can transceiver. pp. 564, 565 representative examples of baud rate settings (fcanmod = 16 mhz) the values in table 16-24 do not guarantee the operation of the network system. thoroughly check the effect on the network system, taking into consideration oscillation errors and delays of the can bus and can transceiver. pp. 566, 567 re-initialization after setting the can module to the initialization mode, avoid setting the module to another operation mode immediatel y after. if it is necessary to immediately set the module to another operation mode, be sure to access registers other than the c0ctrl and c0gmctrl registers (e.g. set a message buffer). p. 569 before a message buffer is initialized, the rdy bit must be cleared. p. 570 message buffer initialization make the following settings for message buffers not used by the application. - clear the rdy, trq, and dn bits of the c0mctrlm register to 0. - clear the ma0 bit of the c0mconfm register to 0. p. 570 the trq bit should be set after the rdy bit is set. p. 573 message transmit processing the rdy bit and trq bit should not be set at the same time. p. 573 abt message transmit processing the abttrg bit should be set to 1 afte r the tstat bit is cleared to 0. checking the tstat bit and setting the abttrg bit to 1 must be processed continuously. p. 574 the trq bit should be set after the rdy bit is set. pp. 575 to 577 transmission via interrupt or software polling the rdy bit and trq bit should not be set at the same time. pp. 575 to 577 execute transmission request abort processing by clearing the trq bit, not the rdy bit. pp. 578, 579 before making a sleep mode transition request, confirm that there is no transmission request left us ing this processing. pp. 578, 579 the tstat bit can be periodically che cked by a user app lication or can be checked after the transmit completion interrupt. pp. 578, 579 do not execute the new transmission request including in the other message buffers while transmission abort processing is in progress. pp. 578, 579 chapter 16 soft can controller transmission abort processing there is a possibility that contradiction is caused in the judgment whether the transmission abort request was successful when the transmission from the same message buffer is c onsecutive or only one mess age buffer is used. in that case, judge it by using the histor y information etc. that the c0tgpt register indicates. pp. 578, 580
appendix d list of cautions user?s manual u19180ej1v0ud 848 (25/32) chapter classification function details of f unction cautions page do not set any transmission requests wh ile abt transmission abort processing is in progress. pp. 581, 582 abt transmission abort processing make a can sleep mode/can stop mode tr ansition request after abttrg bit is cleared (after abt mode is aborted) follo wing the procedure shown in figure 16- 49 or 16-50. when clearing a transmi ssion request in an area other than the abt area, follow the procedur e shown in figure 16-47. pp. 581, 582 setting can sleep mode/stop mode to abort transmission before making a r equest for the can sleep mode, perform processing according to figures 16-47 to 16-50. p. 586 bus-off recovery when the transmission from the initialization mode to any operation modes is requested to execute bus-off recovery sequence again in the bus-off recovery sequence, reception error count er is cleared. therefore it is necessary to detect 11 consecutive recessive-level bits 128 times on the bus again. pp. 588, 589 forced shutdown process do not read- or write-access any regist ers by software between setting the efsd bit and clearing the gom bit. p. 591 setting cpu standby (from can sleep mode) before the cpu is set in the cpu standby mode, please check the can sleep mode or not. however, after check of the can sleep mode, until the cpu is set in the cpu standby mode, the can sleep mode may be cancelled by wakeup from can bus. p. 593 chapter 16 soft can controller setting cpu standby (from can stop mode) the can stop mode can only be released by writing 01b to the psmode [1:0] bit of the c0ctrl register and not by a change in the can bus state. p. 594 when operating a timer, serial interface, or a/d converter after standby release, operate it once after clearing the interrupt request flag. an interrupt request flag may be set by noise. p. 601 when manipulating a flag of the interr upt request flag register, use a 1-bit memory manipulation instruction (clr1) . when describing in c language, use a bit manipulation instruction such as ?if0l.0 = 0;? or ?_asm(?clr1 if0l, 0?);? because the compiled assembler must be a 1-bit memory manipulation instruction (clr1). if a program is described in c language using an 8-bit memory manipulation instruction such as ?if0l &= 0xfe;? and compiled, it becomes the assembler of three instructions. mov a, if0l and a, #0feh mov if0l, a in this case, even if the request flag of another bit of the same interrupt request flag register (if0l) is set to 1 at the timing between ?mov a, if0l? and ?mov if0l, a?, the flag is cleared to 0 at ?mov if0l, a?. therefore, care must be exercised when using an 8-bit memory mani pulation instruction in c language. p. 601 be sure to set bits 2, 5 to 7 of if1h to 0. (78k0/fc2) p. 602 1f0l, 1f0l, 1f1l, 1f1h: interrupt request flag registers be sure to set bits 5 to 7 of if1h to 0. (78k0/fe2, 78k0/ff2) p. 603 be sure to set bits 2, 5 to 7 of mk1h to 1. (78k0/fc2) p. 604 mk0l, mk0h, mk1l, mk1h: interrupt mask flag registers be sure to set bits 5 to 7 of mk1h to 1. (78k0/fe2, 78k0/ff2) p. 605 be sure to set bit 2, 5 to 7 of pr1h to 1. (78k0/fc2) p. 606 pr0l, pr0h, pr1l, pr1h: priority specification flag registers be sure to set bit 5 to 7 of pr1h to 1. (78k0/fe2, 78k0/ff2) p. 607 egp, egn: external interrupt rising edge, falling edge enable registers select the port mode by clearing eg pn and egnn to 0 because an edge may be detected when the external interrupt func tion is switched to the port function. p. 608 chapter 17 soft interrupt function software interrupt request do not use the reti instruction for restoring from the software interrupt. p. 612
appendix d list of cautions user?s manual u19180ej1v0ud 849 (26/32) chapter classification function details of function cautions page chapter 17 soft interrupt function brk instruction the brk instruction is not one of the above-listed interrupt request hold instructions. however, the software in terrupt activated by executing the brk instruction causes the ie flag to be cleared. therefore, even if a maskable interrupt request is generated during exec ution of the brk instruction, the interrupt request is not acknowledged. p. 616 the stop mode can be used only when the cpu is operating on the main system clock. the subsystem clock oscillati on cannot be stopped. the halt mode can be used when the cpu is operating on either the main system clock or the subsystem clock. p. 617 when shifting to the stop mode, be sure to stop the peripheral hardware operation operating with main system clock before executing stop instruction. p. 617 chapter 18 soft standby function standby function the following sequence is recommended for oper ating current reduction of the a/d converter when the standby function is us ed: first clear bit 7 (adcs) and bit 0 (adce) of the a/d converter mode register (adm) to 0 to stop the a/d conversion operation, and then execute the stop instruction. p. 617 after the above time has elapsed, the bits are set to 1 in order from most11 and remain 1. p. 618 the oscillation stabilization time counter counts up to the oscillation stabilization time set by osts. if the stop mode is entered and then released while the internal high-speed oscillation clock is being used as the cpu clock, set the oscillation stabilization time as follows. ? desired ostc oscillation stabilization time oscillation stabilization time set by osts note, therefore, that only the status up to the oscillation stabilization time set by osts is set to ostc after stop mode is released. p. 618 hard ostc: oscillation stabilization time counter status register the x1 clock oscillation stabilization wait time does not include the time until clock oscillation starts (?a? below). p. 618 to set the stop mode when the x1 clock is used as the cpu clock, set osts before executing the stop instruction. p. 619 do not change the value of the osts register during the x1 clock oscillation stabilization time. p. 619 osts: oscillation stabilization time select register the oscillation stabilization time counter counts up to the oscillation stabilization time set by osts. if the stop mode is entered and then released while the internal high-speed oscillation clock is being used as the cpu clock, set the oscillation stabilization time as follows. ? desired ostc oscillation stabilization time oscillation stabilization time set by osts note, therefore, that only the status up to the oscillation stabilization time set by osts is set to ostc after stop mode is released. p. 619 soft osts: oscillation stabilization time select register the x1 clock oscillation stabilization wait time does not include the time until clock oscillation starts (?a? below). p. 619 because the interrupt request signal is used to clear the standby mode, if there is an interrupt source with the interrupt request flag set and the interrupt mask flag reset, the standby mode is immediately cl eared if set. thus, the stop mode is reset to the halt mode immediately afte r execution of the stop instruction and the system returns to the operating mode as soon as the wait time set using the oscillation stabilization time select register (osts) has elapsed. p. 625 soft stop mode to use the peripheral hardware that st ops operation in the stop mode, and the peripheral hardware for which the clock that stops oscillating in the stop mode after the stop mode is released, restart the peripheral hardware. p. 627
appendix d list of cautions user?s manual u19180ej1v0ud 850 (27/32) chapter classification function details of function cautions page even if ?internal low-speed oscillator can be stopped by software? is selected by the option byte, the internal low-speed oscillator continues in the stop mode in the status before the stop mode is set. to stop the internal low-speed oscillator in the stop mode, stop it by software and then execute the stop instruction. p. 627 to shorten oscillation stabilization time after the stop mode is released when the cpu operates with the high-speed system clo ck (x1 oscillation), temporarily switch the cpu clock to the internal high-speed oscillator internal oscillation clock before the next execution of the stop instructi on. before changing the cpu clock from the internal high-speed oscillator to the highspeed system clock (x 1 oscillation) after the stop mode is released, check the oscillation stabilization time with the oscillation stabilization time counter status register (ostc). p. 627 if the stop instruction is executed when amph = 1, supply of the cpu clock is stopped for 4.06 to 16.12 s after the stop mode is released when the internal high-speed oscillation clock is selected as the cpu clock, or for the duration of 160 external clocks when the high-speed system clock (external clock input) is selected as the cpu clock. p. 627 chapter 18 soft standby function stop mode execute the stop instruction after havi ng confirmed that the internal high-speed oscillator is operating stably (rsts = 1). p. 627 for an external reset, input a low level for 10 s or more to the reset pin. p. 632 during reset input, the x1 clock, xt1 clock, internal high-speed oscillation clock, and internal low-speed oscillation clock stop o scillating. external main system clock input and external subsystem clock input become invalid. p. 632 ? when the stop mode is released by a reset, the stop mode contents are held during reset input. however, the port pins become high-impedance, except for p130, which is set to low-level output. p. 632 block diagram of reset function an lvi circuit internal reset does not reset the lvi circuit. p. 633 hard watchdog timer overflow a watchdog timer internal reset resets the watchdog timer. p. 634 chapter 19 soft reset function resf: reset control flag register do not read data by a 1-bit memory manipulation instruction. p. 640 the value read from sdr0 during operati on processing (while bit 7 (dmue) of multiplier/divider control register 0 (dmuc0) is 1) is not guaranteed. p. 643 sdr0: remainder data register 0 sdr0 is reset when the operation is started (when dmue is set to 1). p. 643 mda0h is cleared to 0 when an operation is started in the multiplication mode (when multiplier/divider control register 0 (dmuc0) is set to 81h). p. 643 do not change the value of mda0 during operation processing (while bit 7 (dmue) of multiplier/divider control register 0 (dmuc0) is 1). even in this case, the operation is executed, but the result is undefined. p. 643 mda0h, mda0l: multiplication/ division data register a0 the value read from mda0 during operation processing (while dmue is 1) is not guaranteed. p. 643 do not change the value of mdb0 during operation processing (while bit 7 (dmue) of multiplier/divider control register 0 (dmuc0) is 1). even in this case, the operation is executed, but the result is undefined. p. 644 mdb0: multiplication/ division data register b0 do not clear mdb0 to 0000h in the division mode. if set, undefined operation results are stored in mda0 and sdr0. p. 644 if dmue is cleared to 0 during operati on processing (when dmue is 1), the operation result is not guaranteed. if the operation is completed while the clearing instruction is being executed, the operati on result is guaranteed, provided that the interrupt flag is set. p. 645 chapter 20 soft multiplier/ divider dmuc0: multiplier/divider control register 0 do not change the value of dmusel0 duri ng operation processing (while dmue is 1). if it is changed, undefined operation resu lts are stored in multiplication/division data register a0 (mda0) and remainder data register 0 (sdr0). p. 645
appendix d list of cautions user?s manual u19180ej1v0ud 851 (28/32) chapter classification function details of function cautions page chapter 20 soft multiplier/ divider dmuc0: multiplier/divider control register 0 if dmue is cleared to 0 during operation processing (while dmue is 1), the operation processing is stopped. to execute the operation again, set multiplication/division data register a0 (m da0), multiplication/division data register b0 (mdb0), and multiplier/divider control register 0 (dmuc0), and start the operation (by setting dmue to 1). p. 645 if an internal reset signal is generated in the poc circuit, the reset control flag register (resf) is cleared to 00h. p. 650 ? set the low-voltage detector by software after the reset status is released (see chapter 22 low-voltage detector). pp. 652, 653 in 2.7 v/1.59 v poc mode a voltage oscillation stabilization time of 1.93 to 5.39 ms is required after the supply voltage reaches 1.59 v (typ.). if the supply voltage rises from 1.59 v (typ.) to 2.7 v (typ.) within 1.93 ms, the power supply oscillation stabilization time of 0 to 5.39 ms is automatic ally generated before reset processing. p. 653 chapter 21 soft power-on- clear circuit cautions for power-on-clear circuit in a system where the supply voltage (v dd ) fluctuates for a certain period in the vicinity of the poc detection voltage (v poc ), the system may be repeatedly reset and released from the reset status. in this case, the time from release of reset to the start of the operation of the microcont roller can be arbitrarily set by taking the following action. p. 654 soft to stop lvi, follow either of the procedures below. ? when using 8-bit memory manipulati on instruction: write 00h to lvim. ? when using 1-bit memory manipulati on instruction: clear lvion to 0. p. 659 hard input voltage from external input pin (exlvi) must be exlvi < v dd . p. 659 lvim: low- voltage detection register when using lvi as an interrupt, if lvion is cleared (0) in a state below the lvi detection voltage, an intlvi signal is generated and lviif becomes 1. p. 659 be sure to clear bits 4 to 7 to 0. p. 659 do not change the value of lvis during lvi operation. p. 659 lvis: low- voltage detection level selection register when an input voltage from the external input pin (exlvi) is detected, the detection voltage (v exlvi = 1.21 v (typ.)) is fixed. ther efore, setting of lvis is not necessary. p. 659 <1> must always be executed. when lvimk = 0, an interrupt may occur immediately after the processing in <4>. p. 661 when used as reset (when detecting level of supply voltage (v dd )) if supply voltage (v dd ) detection voltage (v lvi ) when lvimd is set to 1, an internal reset signal is not generated. p. 661 <1> must always be executed. when lvimk = 0, an interrupt may occur immediately after the processing in <3>. p. 664 soft if input voltage from external input pin (exlvi) detection voltage (v exlvi = 1.21 v (typ.)) when lvimd is set to 1, an internal reset signal is not generated. p. 664 when used as reset (when detecting level of input voltage from external input pin (exlvi)) input voltage from external input pin (exlvi) must be exlvi < v dd . p. 664 hard when used as interrupt (when detecting level of input voltage from external input pin (exlvi)) input voltage from external input pin (exlvi) must be exlvi < v dd . p. 669 chapter 22 soft low- voltage detector cautions for low-voltage detector in a system where the supply voltage (v dd ) fluctuates for a certain period in the vicinity of the lvi detection voltage (v lvi ), the operation is as follows depending on how the low-voltage detector is used. (1) when used as reset the system may be repeatedly reset and released from the reset status. in this case, the time from release of reset to the start of the operation of the microcontroller can be ar bitrarily set by taking action (1) below. (2) when used as interrupt interrupt requests may be frequently generat ed. take (b) of action (2) below. p. 671
appendix d list of cautions user?s manual u19180ej1v0ud 852 (29/32) chapter classification function details of function cautions page 0082h, 0083h/ 1082h, 1083h be sure to set 00h to 0082h and 0083h (0082h/1082h and 0083h/1083h when the boot swap function is used). p. 674 0080h/1080h set a value that is the same as that of 0080h to 1080h because 0080h and 1080h are switched during the boot swap operation. p. 674 0081h/1081h lvistart can only be written by usi ng a dedicated flash memory programmer. it cannot be set during self-programming or boot swap operation during self- programming (at this time, 1.59 v poc mode (default) is set). however, because the value of 1081h is copied to 0081h during the boot swap operation, it is recommended to set a value that is the same as that of 0081h to 1081h when the boot swap function is used. p. 674 0084h/1084h to use the on-chip debug function, set 02h or 03h to 0084h. set a value that is the same as that of 0084h to 1084h bec ause 0084h and 1084h are switched during the boot operation. p. 675 the combination of wdcs2 = wdcs1 = wdcs0 = 0 and window1 = window0 = 0 is prohibited. p. 676 the watchdog timer continues its operation during self-programming and eeprom emulation of the flash memory. during proc essing, the interrupt acknowledge time is delayed. set the overflow time and window si ze taking this delay into consideration. p. 676 if lsrosc = 0 (oscillation can be stopped by software), the count clock is not supplied to the watchdog timer in the ha lt and stop modes, regardless of the setting of bit 0 (lsrstop) of the internal oscillation mode register (rcm). when 8-bit timer h1 operates with the internal low-speed oscillation clock, the count clock is supplied to 8-bit time r h1 even in the halt/stop mode p. 676 0080h/1080h be sure to clear bit 7 to 0. p. 676 chapter 23 soft option byte 0081h/1081h be sure to clear bits 7 to 1 to ?0?. p. 677 be sure to set each product to the values s hown in table 24-1 after a reset release. p. 679 be sure to set each product to the values show n in table 24-2 after a reset release. p. 680 ims: internal memory size switching register, ixs: internal expansion ram size switching register to set the memory size, set ims and then ixs. set the memory size so that the internal rom and internal expans ion ram areas do not overlap. pp. 679, 680 only the internal high-speed oscillation clock (f rh ) can be used when csi10 is used. p. 697 operation clock only the x1 clock (f x ) or external main system clock (f exclk ) can be used when uart60 is used. p. 697 processing of x1, p31 pins connect p31/intp2/ti002 and p121/x1 as fo llows when writing the flash memory with a flash memory programmer. ? p31/intp2/ti002: connect to ev ss via a resistor (10 k : recommended). ? p121/x1: when using this pi n as a port, connect it to v ss via a resistor (10 k : recommended) (in the input mode) or leave it open (in the output mode). p. 697 soft selecting communication mode when uart60 is selected, the receive clock is calculated based on the reset command sent from the dedicated flash memory programmer after the flmd0 pulse has been received. p. 700 after the security setting for the batch er ase is set, erasure cannot be performed for the device. in addition, even if a write command is executed, data different from that which has already been written to t he flash memory cannot be written, because the erase command is disabled. p. 702 chapter 24 hard flash memory security settings if a security setting that rewrites boot cl uster 0 has been applied, boot cluster 0 of that device will not be rewritten, and the device will not be erased in batch. p. 702 chapter 27 hard flash memory e.p.v. command usage when executing boot swapping, do not use the e.p.v. command with the dedicated flash memory programmer. pp. 704, 705
appendix d list of cautions user?s manual u19180ej1v0ud 853 (30/32) chapter classification function details of function cautions page the self-programming function cannot be used when the cpu operates with the subsystem clock. p. 706 hard input a high level to the flmd0 pin during self-programming. p. 706 be sure to execute the di instruction before starting self-programming. the self-programming function checks the interrupt request flags (if0l, if0h, if1l, and if1h). if an interrupt reques t is generated, self-programming is stopped. p. 706 self-programming is also stopped by an in terrupt request that is not masked even in the di status. to prevent this, mask the interrupt by using the interrupt mask flag registers (mk0l, mk0h, mk1l, and mk1h). p. 706 self-programming is executed with the internal high-speed oscillation clock. if the cpu operates with the x1 clock or exte rnal main system clock, the oscillation stabilization wait time of the internal high-speed oscillation clock elapses during self-programming. p. 706 allocate the entry program for self-programming in the common area of 0000h to 7fffh. p. 707 flash memory programming by self- programming if the flash memory size is 96 kb or 128 kb, specify a flash real address, instead of a cpu address, as a flash write/erase address. p. 707 be sure to keep fwedis at 0 until writi ng or erasing of the flash memory is completed. p. 716 make sure that fwedis = 1 in the normal mode. p. 716 flpmc: format of flash- programming mode control register manipulate flspm1 and flspm0 after executi on branches to the internal ram. the address of the flash memory is spec ified by an address signal from the cpu when flspm1 = 0 or the set value of the firmware written when flspm1 = 1. in the on-board mode, the specifications of flspm1 and flspm0 are ignored. p. 716 chapter 27 soft flash memory boot swap function when executing boot swapping, do not use the e.p.v command with the dedicated flash memory programmer. p. 719 78k0/fx2 micro controller the 78k0/fx2 microcontrollers have an on- chip debug function, which is provided for development and evaluation. do not use the on-chip debug function in products designated for mass producti on, because the guaranteed number of rewritable times of the flash memory may be exceeded when this function is used, and product reliability therefore cannot be guaranteed. nec electronics is not liable for problems occurring when the on-chip debug function is used. p. 721 input the clock from the x1 pin during on-chip debugging. p. 723 chapter 25 hard on-chip debug function when x1 and x2 are used control the x1 and x2 pins by externally pulling down the p31 pin or by using an external circuit using the p130 pin (that outputs a low level when the device is reset). p. 723
appendix d list of cautions user?s manual u19180ej1v0ud 854 (31/32) chapter classification function details of function cautions page when setting to on-chip debugging mode via the normal port, without using pins x1 and x2, two of the user ports will be unavailable for use. p. 726 chapter 25 hard on-chip debug function restrictions and cautions on on-chip debug function in order to realize on-chip debug functi on, use the following user resource. (a) flash memory area { addresses 0x02 and 0x03 { addresses 0x7e and 0x7f (when using a software break) { address 0x84 { addresses 0x85 to 0x8e { addresses 0x8f to 0x18f: standard value of program (+256 bytes when using pseudo real -time ram monitor function) (when using a device with 10 or more sf rs the can be accessed in 16-bit units: +n (the number of exceeding registers x 6 bytes)) (b) internal extended ram area { addresses 0xf7f0 to 0xf7ff (when using pseudo real-time ram monitor function) (c) internal high-speed ram area { 7 bytes as stack area: standard value of stack (+2 bytes when using software breaks) (+7 bytes when using pseudo real -time ram monitor function) p. 726 78k0/fx2 micro controller the 78k0/fx2 microcontrollers have an on- chip debug function, which is provided for development and evaluation. do not use the on-chip debug function in products designated for mass producti on, because the guaranteed number of rewritable times of the flash memory may be exceeded when this function is used, and product reliability therefore cannot be guaranteed. nec electronics is not liable for problems occurring when the on-chip debug function is used. pp. 740, 764 pp. 740, ? the pins mounted depend on the product. 742 to 752, 754 to 764, 766 to 776, 778 to 787 chapters 27, 28 hard electrical specificat ions absolute maximum ratings product quality may suffer if the absol ute maximum rating is exceeded even momentarily for any parameter. that is , the absolute maximum ratings are rated values at which the product is on the verge of suffering physical damage, and therefore the product must be used under c onditions that ensure that the absolute maximum ratings are not exceeded. pp. 742, 743, 766, 767
appendix d list of cautions user?s manual u19180ej1v0ud 855 (32/32) chapter classification function details of function cautions page when using the x1 oscillator, wire as follows in the area enclosed by the broken lines in the above figures to avoid an adverse effect from wiring capacitance. ? keep the wiring length as short as possible. ? do not cross the wiring wi th the other signal lines. ? do not route the wiring near a signal line through which a high fluctuating current flows. ? always make the ground point of the oscillator capacitor the same potential as v ss . ? do not ground the capacitor to a gr ound pattern through which a high current flows. ? do not fetch signals from the oscillator. pp. 744, 768 x1 oscillator characteristics since the cpu is started by the internal high-speed oscillation clock after a reset release, check the x1 clock oscillation stabilization time using the oscillation stabilization time counter status register (ostc) by the user. determine the oscillation stabilization time of the ostc register and oscillation stabilization time select register (osts) after sufficiently evaluating the oscillation stabilization time with the resonator to be used. pp. 744, 768 when using the xt1 oscillator, wire as follows in the area enclosed by the broken lines in the above figure to av oid an adverse effect from wiring capacitance ? keep the wiring length as short as possible. ? do not cross the wiring wi th the other signal lines. ? do not route the wiring near a signal line through which a high fluctuating current flows. ? always make the ground point of the oscillator capacitor the same potential as v ss . ? do not ground the capacitor to a gr ound pattern through which a high current flows. ? do not fetch signals from the oscillator. pp. 745, 769 chapters 27, 28 hard electrical specifications xt1 oscillator characteristics the xt1 oscillator is designed as a low-amplitude circuit for reducing power consumption, and is more prone to malfunction due to noise than the x1 oscillator. particular care is therefore required with the wiring method when the xt1 clock is used. pp. 745, 769 chapter 30 hard recommended soldering conditions ? do not use different soldering methods together (except for partial heating). p. 794 when the cpu is operating on the subsystem clock and the peripheral hardware clock is stopped, do not acce ss the registers listed above using an access method in which a wait request is issued. p. 796 chapter 31 soft wait ? when value is canmod(can module system clock) 2 mhz. p. 797
nec electronics corporation 1753, shimonumabe, nakahara-ku, kawasaki, kanagawa 211-8668, japan tel: 044-435-5111 http://www.necel.com/ [america] nec electronics america, inc. 2880 scott blvd. santa clara, ca 95050-2554, u.s.a. tel: 408-588-6000 800-366-9782 http://www.am.necel.com/ [asia & oceania] nec electronics (china) co., ltd 7th floor, quantum plaza, no. 27 zhichunlu haidian district, beijing 100083, p.r.china tel: 010-8235-1155 http://www.cn.necel.com/ nec electronics shanghai ltd. room 2511-2512, bank of china tower, 200 yincheng road central, pudong new area, shanghai p.r. china p.c:200120 tel: 021-5888-5400 http://www.cn.necel.com/ nec electronics hong kong ltd. unit 1601-1613, 16/f., tower 2, grand century place, 193 prince edward road west, mongkok, kowloon, hong kong tel: 2886-9318 http://www.hk.necel.com/ nec electronics taiwan ltd. 7f, no. 363 fu shing north road taipei, taiwan, r. o. c. tel: 02-8175-9600 http://www.tw.necel.com/ nec electronics singapore pte. ltd. 238a thomson road, #12-08 novena square, singapore 307684 tel: 6253-8311 http://www.sg.necel.com/ nec electronics korea ltd. 11f., samik lavied?or bldg., 720-2, yeoksam-dong, kangnam-ku, seoul, 135-080, korea tel: 02-558-3737 http://www.kr.necel.com/ for further information, please contact: g07.1a [europe] nec electronics (europe) gmbh arcadiastrasse 10 40472 dsseldorf, germany tel: 0211-65030 http://www.eu.necel.com/ hanover office podbielskistrasse 166 b 30177 hannover tel: 0 511 33 40 2-0 munich office werner-eckert-strasse 9 81829 mnchen tel: 0 89 92 10 03-0 stuttgart office industriestrasse 3 70565 stuttgart tel: 0 711 99 01 0-0 united kingdom branch cygnus house, sunrise parkway linford wood, milton keynes mk14 6np, u.k. tel: 01908-691-133 succursale fran?aise 9, rue paul dautier, b.p. 52 78142 velizy-villacoublay cdex france tel: 01-3067-5800 sucursal en espa?a juan esplandiu, 15 28007 madrid, spain tel: 091-504-2787 tyskland filial t?by centrum entrance s (7th floor) 18322 t?by, sweden tel: 08 638 72 00 filiale italiana via fabio filzi, 25/a 20124 milano, italy tel: 02-667541 branch the netherlands steijgerweg 6 5616 hs eindhoven the netherlands tel: 040 265 40 10


▲Up To Search▲   

 
Price & Availability of DUPD78F0884AGAA-GAM-G

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X